diff options
author | Jisheng Zhang <jszhang@marvell.com> | 2016-08-15 02:45:46 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2016-08-22 07:32:29 -0400 |
commit | 5a9e3e156ec1ab26ba70b4c44157858c92bbeee0 (patch) | |
tree | 08786b2c7e30101dc85dd29b6cf8e43be55cd2d5 /arch/arm64/mm | |
parent | b6d081bddf397026575a437b603b118dff2606ff (diff) |
arm64: apply __ro_after_init to some objects
These objects are set during initialization, thereafter are read only.
Previously I only want to mark vdso_pages, vdso_spec, vectors_page and
cpu_ops as __read_mostly from performance point of view. Then inspired
by Kees's patch[1] to apply more __ro_after_init for arm, I think it's
better to mark them as __ro_after_init. What's more, I find some more
objects are also read only after init. So apply __ro_after_init to all
of them.
This patch also removes global vdso_pagelist and tries to clean up
vdso_spec[] assignment code.
[1] http://www.spinics.net/lists/arm-kernel/msg523188.html
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/mm')
-rw-r--r-- | arch/arm64/mm/dma-mapping.c | 3 | ||||
-rw-r--r-- | arch/arm64/mm/init.c | 5 | ||||
-rw-r--r-- | arch/arm64/mm/mmu.c | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index f3953decb171..bdacead5b802 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/gfp.h> | 20 | #include <linux/gfp.h> |
21 | #include <linux/acpi.h> | 21 | #include <linux/acpi.h> |
22 | #include <linux/bootmem.h> | 22 | #include <linux/bootmem.h> |
23 | #include <linux/cache.h> | ||
23 | #include <linux/export.h> | 24 | #include <linux/export.h> |
24 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
25 | #include <linux/genalloc.h> | 26 | #include <linux/genalloc.h> |
@@ -30,7 +31,7 @@ | |||
30 | 31 | ||
31 | #include <asm/cacheflush.h> | 32 | #include <asm/cacheflush.h> |
32 | 33 | ||
33 | static int swiotlb __read_mostly; | 34 | static int swiotlb __ro_after_init; |
34 | 35 | ||
35 | static pgprot_t __get_dma_pgprot(unsigned long attrs, pgprot_t prot, | 36 | static pgprot_t __get_dma_pgprot(unsigned long attrs, pgprot_t prot, |
36 | bool coherent) | 37 | bool coherent) |
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index bbb7ee76e319..251e0824cd82 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/swap.h> | 23 | #include <linux/swap.h> |
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/bootmem.h> | 25 | #include <linux/bootmem.h> |
26 | #include <linux/cache.h> | ||
26 | #include <linux/mman.h> | 27 | #include <linux/mman.h> |
27 | #include <linux/nodemask.h> | 28 | #include <linux/nodemask.h> |
28 | #include <linux/initrd.h> | 29 | #include <linux/initrd.h> |
@@ -55,8 +56,8 @@ | |||
55 | * executes, which assigns it its actual value. So use a default value | 56 | * executes, which assigns it its actual value. So use a default value |
56 | * that cannot be mistaken for a real physical address. | 57 | * that cannot be mistaken for a real physical address. |
57 | */ | 58 | */ |
58 | s64 memstart_addr __read_mostly = -1; | 59 | s64 memstart_addr __ro_after_init = -1; |
59 | phys_addr_t arm64_dma_phys_limit __read_mostly; | 60 | phys_addr_t arm64_dma_phys_limit __ro_after_init; |
60 | 61 | ||
61 | #ifdef CONFIG_BLK_DEV_INITRD | 62 | #ifdef CONFIG_BLK_DEV_INITRD |
62 | static int __init early_initrd(char *p) | 63 | static int __init early_initrd(char *p) |
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 4989948d1feb..e634a0f6d62b 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c | |||
@@ -17,6 +17,7 @@ | |||
17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <linux/cache.h> | ||
20 | #include <linux/export.h> | 21 | #include <linux/export.h> |
21 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
22 | #include <linux/errno.h> | 23 | #include <linux/errno.h> |
@@ -46,7 +47,7 @@ | |||
46 | 47 | ||
47 | u64 idmap_t0sz = TCR_T0SZ(VA_BITS); | 48 | u64 idmap_t0sz = TCR_T0SZ(VA_BITS); |
48 | 49 | ||
49 | u64 kimage_voffset __read_mostly; | 50 | u64 kimage_voffset __ro_after_init; |
50 | EXPORT_SYMBOL(kimage_voffset); | 51 | EXPORT_SYMBOL(kimage_voffset); |
51 | 52 | ||
52 | /* | 53 | /* |