android_kernel_motorola_sm6225/arch
Mike Rapoport (IBM) 9d9b7fa50e x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size
[ Upstream commit a1e2b8b36820d8c91275f207e77e91645b7c6836 ]

Qi Zheng reported crashes in a production environment and provided a
simplified example as a reproducer:

 |  For example, if we use Qemu to start a two NUMA node kernel,
 |  one of the nodes has 2M memory (less than NODE_MIN_SIZE),
 |  and the other node has 2G, then we will encounter the
 |  following panic:
 |
 |    BUG: kernel NULL pointer dereference, address: 0000000000000000
 |    <...>
 |    RIP: 0010:_raw_spin_lock_irqsave+0x22/0x40
 |    <...>
 |    Call Trace:
 |      <TASK>
 |      deactivate_slab()
 |      bootstrap()
 |      kmem_cache_init()
 |      start_kernel()
 |      secondary_startup_64_no_verify()

The crashes happen because of inconsistency between the nodemask that
has nodes with less than 4MB as memoryless, and the actual memory fed
into the core mm.

The commit:

  9391a3f9c7 ("[PATCH] x86_64: Clear more state when ignoring empty node in SRAT parsing")

... that introduced minimal size of a NUMA node does not explain why
a node size cannot be less than 4MB and what boot failures this
restriction might fix.

Fixes have been submitted to the core MM code to tighten up the
memory topologies it accepts and to not crash on weird input:

  mm: page_alloc: skip memoryless nodes entirely
  mm: memory_hotplug: drop memoryless node from fallback lists

Andrew has accepted them into the -mm tree, but there are no
stable SHA1's yet.

This patch drops the limitation for minimal node size on x86:

  - which works around the crash without the fixes to the core MM.
  - makes x86 topologies less weird,
  - removes an arbitrary and undocumented limitation on NUMA topologies.

[ mingo: Improved changelog clarity. ]

Reported-by: Qi Zheng <zhengqi.arch@bytedance.com>
Tested-by: Mario Casquero <mcasquer@redhat.com>
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Rik van Riel <riel@surriel.com>
Link: https://lore.kernel.org/r/ZS+2qqjEO5/867br@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-28 16:46:31 +00:00
..
alpha alpha: remove __init annotation from exported page_is_ram() 2023-08-16 18:13:01 +02:00
arc ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard 2023-08-11 11:45:11 +02:00
arm ARM: 9321/1: memset: cast the constant byte to unsigned char 2023-11-20 10:29:19 +01:00
arm64 arm64: fix a concurrency issue in emulation_proc_handler() 2023-11-08 11:22:17 +01:00
c6x
h8300 h8300: Fix build errors from do_exit() to make_task_dead() transition 2023-02-06 07:49:45 +01:00
hexagon hexagon: Fix function name in die() 2023-02-06 07:49:45 +01:00
ia64 treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
m68k m68k: Fix invalid .section syntax 2023-09-23 10:47:57 +02:00
microblaze exit: Add and use make_task_dead. 2023-02-06 07:49:45 +01:00
mips MIPS: Alchemy: only build mmc support helpers if au1xmmc is enabled 2023-10-10 21:44:58 +02:00
nds32 exit: Add and use make_task_dead. 2023-02-06 07:49:45 +01:00
nios2 nios2: dts: Fix tse_mac "max-frame-size" property 2023-06-21 15:39:57 +02:00
openrisc openrisc: Properly store r31 to pt_regs on unhandled exceptions 2023-05-17 11:13:19 +02:00
parisc parisc: Restore __ldcw_align for PA-RISC 2.0 processors 2023-10-10 21:45:02 +02:00
powerpc powerpc/64e: Fix wrong test in __ptep_test_and_clear_young() 2023-10-25 11:16:36 +02:00
riscv riscv: Bump COMMAND_LINE_SIZE value to 1024 2023-04-05 11:15:36 +02:00
s390 s390/pci: fix iommu bitmap allocation 2023-10-25 11:17:02 +02:00
sh sh: bios: Revive earlyprintk support 2023-11-20 10:29:19 +01:00
sparc sparc: fix up arch_cpu_finalize_init() build breakage. 2023-08-16 18:12:59 +02:00
um um: Fix hostaudio build errors 2023-09-23 10:48:09 +02:00
unicore32
x86 x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size 2023-11-28 16:46:31 +00:00
xtensa xtensa: ISS: fix call to split_if_spec 2023-08-11 11:45:23 +02:00
.gitignore
Kconfig init: Provide arch_cpu_finalize_init() 2023-08-08 19:49:17 +02:00