[PATCH v2 0/3] mm: memblock: fix debugfs flag reporting and synchronization
From: Meijing Zhao
Date: Thu Aug 20 2026 - 03:51:37 EST
From: Meijing Zhao <zhaomeijing@xxxxxxxxxxx>
The memblock debugfs interface has two issues when reporting region
flags. MEMBLOCK_RSRV_HUGETLB has no corresponding name, and regions
with multiple flags only show the lowest set bit.
In addition, memblock_debug_show() walks the region arrays without
synchronizing against memory hotplug. If memory hotplug grows an array,
the debugfs reader may continue accessing the old array after it has
been freed.
Add the missing HugeTLB flag name, report every set bit including those
beyond flagname[], and hold the memory hotplug read lock while walking
the arrays.
With the series applied, a HugeTLB bootmem reservation is reported as:
RSV_KERN|RSV_HUGETLB
Changes in v2:
- Report set bits beyond flagname[] as UNKNOWN instead of ignoring them.
- Add a separate patch to synchronize debugfs reads with memory hotplug.
v1: https://lore.kernel.org/linux-mm/20260819075422.2387980-1-zhaomeijing100@xxxxxxxxx/
Meijing Zhao (3):
mm: memblock: add missing HugeTLB flag name
mm: memblock: show all region flags in debugfs
mm: memblock: synchronize debugfs reads with memory hotplug
mm/memblock.c | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
--
2.25.1