diff options
author | Jisheng Zhang <jszhang@marvell.com> | 2016-08-15 08:45:46 +0200 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2016-08-22 13:32:29 +0200 |
commit | 5a9e3e156ec1ab26ba70b4c44157858c92bbeee0 (patch) | |
tree | 08786b2c7e30101dc85dd29b6cf8e43be55cd2d5 /arch/arm64/kernel/cpu_ops.c | |
parent | arm64: vdso: constify vm_special_mapping used for aarch32 vectors page (diff) | |
download | linux-5a9e3e156ec1ab26ba70b4c44157858c92bbeee0.tar.xz linux-5a9e3e156ec1ab26ba70b4c44157858c92bbeee0.zip |
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/kernel/cpu_ops.c')
-rw-r--r-- | arch/arm64/kernel/cpu_ops.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm64/kernel/cpu_ops.c b/arch/arm64/kernel/cpu_ops.c index c7cfb8fe06f9..e137ceaf5016 100644 --- a/arch/arm64/kernel/cpu_ops.c +++ b/arch/arm64/kernel/cpu_ops.c @@ -17,6 +17,7 @@ */ #include <linux/acpi.h> +#include <linux/cache.h> #include <linux/errno.h> #include <linux/of.h> #include <linux/string.h> @@ -28,7 +29,7 @@ extern const struct cpu_operations smp_spin_table_ops; extern const struct cpu_operations acpi_parking_protocol_ops; extern const struct cpu_operations cpu_psci_ops; -const struct cpu_operations *cpu_ops[NR_CPUS]; +const struct cpu_operations *cpu_ops[NR_CPUS] __ro_after_init; static const struct cpu_operations *dt_supported_cpu_ops[] __initconst = { &smp_spin_table_ops, |