1
0
Fork 0
alistair23-linux/arch
Lorenzo Pieralisi e189624916 arm64: numa: rework ACPI NUMA initialization
Current ACPI ARM64 NUMA initialization code in

acpi_numa_gicc_affinity_init()

carries out NUMA nodes creation and cpu<->node mappings at the same time
in the arch backend so that a single SRAT walk is needed to parse both
pieces of information.  This implies that the cpu<->node mappings must
be stashed in an array (sized NR_CPUS) so that SMP code can later use
the stashed values to avoid another SRAT table walk to set-up the early
cpu<->node mappings.

If the kernel is configured with a NR_CPUS value less than the actual
processor entries in the SRAT (and MADT), the logic in
acpi_numa_gicc_affinity_init() is broken in that the cpu<->node mapping
is only carried out (and stashed for future use) only for a number of
SRAT entries up to NR_CPUS, which do not necessarily correspond to the
possible cpus detected at SMP initialization in
acpi_map_gic_cpu_interface() (ie MADT and SRAT processor entries order
is not enforced), which leaves the kernel with broken cpu<->node
mappings.

Furthermore, given the current ACPI NUMA code parsing logic in
acpi_numa_gicc_affinity_init(), PXM domains for CPUs that are not parsed
because they exceed NR_CPUS entries are not mapped to NUMA nodes (ie the
PXM corresponding node is not created in the kernel) leaving the system
with a broken NUMA topology.

Rework the ACPI ARM64 NUMA initialization process so that the NUMA
nodes creation and cpu<->node mappings are decoupled. cpu<->node
mappings are moved to SMP initialization code (where they are needed),
at the cost of an extra SRAT walk so that ACPI NUMA mappings can be
batched before being applied, fixing current parsing pitfalls.

Acked-by: Hanjun Guo <hanjun.guo@linaro.org>
Tested-by: John Garry <john.garry@huawei.com>
Fixes: d8b47fca8c ("arm64, ACPI, NUMA: NUMA support based on SRAT and
SLIT")
Link: http://lkml.kernel.org/r/1527768879-88161-2-git-send-email-xiexiuqi@huawei.com
Reported-by: Xie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Punit Agrawal <punit.agrawal@arm.com>
Cc: Jonathan Cameron <jonathan.cameron@huawei.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Hanjun Guo <guohanjun@huawei.com>
Cc: Ganapatrao Kulkarni <gkulkarni@caviumnetworks.com>
Cc: Jeremy Linton <jeremy.linton@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Xie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2018-07-09 18:21:40 +01:00
..
alpha alpha: Remove custom dec_and_lock() implementation 2018-06-12 23:33:24 +02:00
arc mm: introduce ARCH_HAS_PTE_SPECIAL 2018-06-07 17:34:35 -07:00
arm kvm/arm: use PSR_AA32 definitions 2018-07-05 17:24:15 +01:00
arm64 arm64: numa: rework ACPI NUMA initialization 2018-07-09 18:21:40 +01:00
c6x Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-06-04 20:27:54 -07:00
h8300 Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-06-04 20:27:54 -07:00
hexagon hexagon: drop the unused variable zero_page_mask 2018-06-15 07:55:25 +09:00
ia64 - Error path bug fix for overflow tests (Dan) 2018-06-12 18:28:00 -07:00
m68k Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2018-06-05 10:51:30 -07:00
microblaze Microblaze patches for 4.18-rc3 2018-06-27 09:49:30 -07:00
mips MIPS: Add ksig argument to rseq_{signal_deliver,handle_notify_resume} 2018-06-24 10:33:03 -07:00
nds32 Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-06-04 20:27:54 -07:00
nios2 Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-06-04 20:27:54 -07:00
openrisc Kbuild updates for v4.18 2018-06-06 11:00:15 -07:00
parisc parisc: Build kernel without -ffunction-sections 2018-06-29 17:27:20 +02:00
powerpc Kbuild fixes for v4.18 2018-06-30 13:05:30 -07:00
riscv RISC-V Updates for the 4.18 Merge Window 2018-06-16 06:42:43 +09:00
s390 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2018-06-19 07:44:51 +09:00
sh arch/*: Kconfig: fix documentation for NMI watchdog 2018-06-15 12:48:59 -03:00
sparc arch/*: Kconfig: fix documentation for NMI watchdog 2018-06-15 12:48:59 -03:00
um Solve a series of broken links for files under Documentation: 2018-06-17 05:25:18 +09:00
unicore32 docs: Fix some broken references 2018-06-15 18:10:01 -03:00
x86 x86/mm: Add TLB purge to free pmd/pte page interfaces 2018-07-04 21:37:09 +02:00
xtensa docs: Fix some broken references 2018-06-15 18:10:01 -03:00
.gitignore
Kconfig docs: Fix some broken references 2018-06-15 18:10:01 -03:00