[PATCH 0/6] mm, memory_hotplug: handle unitialized numa node gracefully
From: Michal Hocko
Date: Thu Jan 27 2022 - 03:53:20 EST
Hi,
the previous version of this patchset has been posted her:
http://lkml.kernel.org/r/20211214100732.26335-1-mhocko@xxxxxxxxxx
I have ended up with 6 patches in the end. The core of the fix is patch
2 which also links existing bug reports. The high level goal is to have
all possible numa nodes have their pgdat allocated and initialized so
for_each_possible_node(nid)
NODE_DATA(nid)
will never return a garbage. This has proven to be problem in several
places when an offline numa node is used for an allocation just to
realize that node_data and therefore allocation fallback zonelists are
not initialized and such an allocation request blows up.
There were attempts to address that by checking node_online in several
places including the page allocator. This patchset approaches the
problem from a different perspective and instead of special casing,
which just adds a runtime overhead, it allocates pglist_data for each
possible node. This can add some memory overhead for platforms with high
number of possible nodes if they do not contain any memory. This should
be a rather rare configuration though.
How to test this? David has provided and excellent howto:
http://lkml.kernel.org/r/6e5ebc19-890c-b6dd-1924-9f25c441010d@xxxxxxxxxx
Patches 1 and 3-6 are mostly cleanups. The patchset has been reviewed by
Rafael (thanks!) and the core fix tested by Rafael and Alexey (thanks to
both). David has tested as per instructions above and hasn't found any
fallouts in the memory hotplug scenarios.
Please consider for inclusion.
Thanks!
Diffstat:
arch/ia64/mm/discontig.c | 11 +---
include/linux/memory_hotplug.h | 118 ++++++++++++++++++++---------------------
mm/memcontrol.c | 14 +----
mm/memory_hotplug.c | 55 ++++---------------
mm/page_alloc.c | 70 +++++++++++++++++++++---
5 files changed, 133 insertions(+), 135 deletions(-)