Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] mm: memblock: fix debugfs flag reporting and synchronization
@ 2026-08-20  7:51 Meijing Zhao
  2026-08-20  7:51 ` [PATCH v2 1/3] mm: memblock: add missing HugeTLB flag name Meijing Zhao
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Meijing Zhao @ 2026-08-20  7:51 UTC (permalink / raw)
  To: Mike Rapoport, Andrew Morton
  Cc: linux-mm, linux-kernel, Wandun Chen, Meijing Zhao

From: Meijing Zhao <zhaomeijing@lixiang.com>

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@gmail.com/

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-20  7:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20  7:51 [PATCH v2 0/3] mm: memblock: fix debugfs flag reporting and synchronization Meijing Zhao
2026-08-20  7:51 ` [PATCH v2 1/3] mm: memblock: add missing HugeTLB flag name Meijing Zhao
2026-08-20  7:51 ` [PATCH v2 2/3] mm: memblock: show all region flags in debugfs Meijing Zhao
2026-08-20  7:51 ` [PATCH v2 3/3] mm: memblock: synchronize debugfs reads with memory hotplug Meijing Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox