kernel_samsung_a53x/arch/x86
Mike Rapoport (IBM) f0cd92ff4b 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:

  9391a3f9c7f1 ("[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>
2024-11-18 11:43:12 +01:00
..
boot x86/sev: Check for user-space IOIO pointing to kernel space 2024-11-08 11:26:09 +01:00
configs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
crypto Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
entry Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
events x86: Share definition of __is_canonical_address() 2024-11-18 11:43:11 +01:00
hyperv Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ia32 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
include x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size 2024-11-18 11:43:12 +01:00
kernel x86/boot: Fix incorrect startup_gdt_descr.size 2024-11-18 11:42:47 +01:00
kvm x86: Share definition of __is_canonical_address() 2024-11-18 11:43:11 +01:00
lib iov_iter, x86: Be consistent about the __user tag on copy_mc_to_user() 2024-11-18 11:42:39 +01:00
math-emu Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mm x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size 2024-11-18 11:43:12 +01:00
net Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
oprofile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pci Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
platform Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
power Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
purgatory Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ras Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
realmode Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tools Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
um Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
video Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xen Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kbuild Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig.assembler Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig.cpu Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig.debug Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile.um Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile_32.cpu Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00