arm64: Dereference CPU operations indirectly
cover arm64: Dereference CPU operations indirectly
In current implementation, an array (@cpu_ops[NR_CPUS]) is maintained to dereference the CPU operations. 2KB memory are consumed when NR_CPUS is configured to 256. It's too much than what I expected. This series reworks the implementation to dereference the CPU operations indirectly, so that less memory (256 bytes) will be consumed for the same purpose.
PATCH[1/4] isn't too much relevant, to declare ACPI parking protocol only when CONFIG_ARM64_ACPI_PARKING_PROTOCOL has been enabled. PATCH[2/4] renames cpu_read_ops() to init_cpu_ops(), which is obviously more precise because it's initializing the CPU operations. PATCH[3/4] introduces get_cpu_ops(), preparing for dereferencing CPU operations indirectly. PATCH[4/4] makes dereferencing CPU operations indirectly happen.
Gavin Shan (4):
arm64: Declare ACPI parking protocol CPU operation if needed
arm64: Rename cpu_read_ops() to init_cpu_ops()
arm64: Introduce get_cpu_ops() helper function
arm64: Dereference CPU operations indirectly
arch/arm64/include/asm/cpu_ops.h | 8 ++--- arch/arm64/kernel/cpu_ops.c | 51 +++++++++++++++++---------- arch/arm64/kernel/cpuidle.c | 9 ++--- arch/arm64/kernel/setup.c | 8 +++-- arch/arm64/kernel/smp.c | 59 ++++++++++++++++++++++---------- 5 files changed, 86 insertions(+), 49 deletions(-)
Signature · 7 lines
2.23.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel