Commit 9062c1d0 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Will Deacon

iommu/io-pgtable: Move some initialization data to .init.rodata

The memory used by '__init' functions can be freed once the initialization
phase has been performed.

Mark some 'static const' array defined and used within some '__init'
functions as '__initconst', so that the corresponding data can also be
discarded.

Without '__initconst', the data are put in the .rodata section.
With the qualifier, they are put in the .init.rodata section.

With gcc 8.3.0, the following changes have been measured:

Without '__initconst':
   section      size
  .rodata       00000720
  .init.rodata  00000018

With '__initconst':
   section      size
  .rodata       00000660
  .init.rodata  00000058
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent 931a0ba6
...@@ -1113,7 +1113,7 @@ static void __init arm_lpae_dump_ops(struct io_pgtable_ops *ops) ...@@ -1113,7 +1113,7 @@ static void __init arm_lpae_dump_ops(struct io_pgtable_ops *ops)
static int __init arm_lpae_run_tests(struct io_pgtable_cfg *cfg) static int __init arm_lpae_run_tests(struct io_pgtable_cfg *cfg)
{ {
static const enum io_pgtable_fmt fmts[] = { static const enum io_pgtable_fmt fmts[] __initconst = {
ARM_64_LPAE_S1, ARM_64_LPAE_S1,
ARM_64_LPAE_S2, ARM_64_LPAE_S2,
}; };
...@@ -1212,13 +1212,13 @@ static int __init arm_lpae_run_tests(struct io_pgtable_cfg *cfg) ...@@ -1212,13 +1212,13 @@ static int __init arm_lpae_run_tests(struct io_pgtable_cfg *cfg)
static int __init arm_lpae_do_selftests(void) static int __init arm_lpae_do_selftests(void)
{ {
static const unsigned long pgsize[] = { static const unsigned long pgsize[] __initconst = {
SZ_4K | SZ_2M | SZ_1G, SZ_4K | SZ_2M | SZ_1G,
SZ_16K | SZ_32M, SZ_16K | SZ_32M,
SZ_64K | SZ_512M, SZ_64K | SZ_512M,
}; };
static const unsigned int ias[] = { static const unsigned int ias[] __initconst = {
32, 36, 40, 42, 44, 48, 32, 36, 40, 42, 44, 48,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment