linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/5] arm64: Dereference CPU operations indirectly
@ 2020-02-26  0:23 Gavin Shan
  2020-02-26  0:23 ` [PATCH v4 1/5] arm64: Declare ACPI parking protocol CPU operation if needed Gavin Shan
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Gavin Shan @ 2020-02-26  0:23 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: mark.rutland, lorenzo.pieralisi, catalin.marinas, robin.murphy,
	shan.gavin, sudeep.holla, will

The subject perhaps can't precisely indicate what this series does, but
keep it same as before for consistency.

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 by using
a CPU operations pointer with assumption - all CPUs should have unified
CPU operations. With this, 8-bytes memory will be used for same purpose.

PATCH[1/5] isn't too much relevant, to declare ACPI parking protocol only
when CONFIG_ARM64_ACPI_PARKING_PROTOCOL has been enabled. PATCH[2/5]
renames cpu_read_ops() to init_cpu_ops(), which is obviously more precise
because it's initializing the CPU operations. PATCH[3/5] introduces
get_cpu_ops(), preparing for droping the array of CPU operations.
PATCH[4/5] removes the CPU operations deferencing array and replaces it
with a pointer with the assumption: all CPUs should have same enablement
method. PATCH[5/5] removes the cpu argument of get_cpu_ops() as it's not
used any more.

Changelog
=========
v4:
   * Rebase to 5.6.rc3 and retest                        (Gavin Shan)
   * Improved commit log for PATCH[4/5] with link tag    (Lorenzo Pieralisi)
   * Using pointer instead of index to dereference the
     unified CPU operations                              (Lorenzo Pieralisi)
   * Merge logic of cpu_get_ops() to get_cpu_method()    (Gavin Shan)
v3:
   * Assume all CPUs have same enablement method. With this, the used
     memory is further squeezed from 64 bytes to 4 bytes (Lorenzo Pieralisi)
   * Add PATCH[5/5] to remove argument of get_cpu_ops()  (Gavin Shan)
v2:
   * Pack 4 CPUs' indexes into one byte. 64 bytes are consumed in order
     to get the CPU operations                            (Robin Murphy)
   * Use ARRAY_SIZE() to iterate @cpu_ops[]               (Robin Murphy)
   * Make index-0 valid                                   (Robin Murphy)

Gavin Shan (5):
  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: Remove CPU operations dereferencing array
  arm64: Remove argument @cpu of get_cpu_ops()

 arch/arm64/include/asm/cpu_ops.h |  8 ++--
 arch/arm64/kernel/cpu_ops.c      | 77 ++++++++++++++++----------------
 arch/arm64/kernel/cpuidle.c      | 10 ++---
 arch/arm64/kernel/setup.c        |  8 ++--
 arch/arm64/kernel/smp.c          | 60 ++++++++++++++++---------
 5 files changed, 93 insertions(+), 70 deletions(-)

-- 
2.23.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-03-18 22:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-26  0:23 [PATCH v4 0/5] arm64: Dereference CPU operations indirectly Gavin Shan
2020-02-26  0:23 ` [PATCH v4 1/5] arm64: Declare ACPI parking protocol CPU operation if needed Gavin Shan
2020-03-17 10:28   ` Mark Rutland
2020-03-18  2:06     ` Gavin Shan
2020-02-26  0:23 ` [PATCH v4 2/5] arm64: Rename cpu_read_ops() to init_cpu_ops() Gavin Shan
2020-03-17 10:20   ` Mark Rutland
2020-02-26  0:23 ` [PATCH v4 3/5] arm64: Introduce get_cpu_ops() helper function Gavin Shan
2020-03-17 10:48   ` Mark Rutland
2020-03-18  2:22     ` Gavin Shan
2020-02-26  0:23 ` [PATCH v4 4/5] arm64: Remove CPU operations dereferencing array Gavin Shan
2020-03-17 10:56   ` Mark Rutland
2020-03-18  3:53     ` Gavin Shan
2020-03-18 22:53       ` Gavin Shan
2020-02-26  0:23 ` [PATCH v4 5/5] arm64: Remove argument @cpu of get_cpu_ops() Gavin Shan
2020-03-16  3:05 ` [PATCH v4 0/5] arm64: Dereference CPU operations indirectly Gavin Shan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).