Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 RESEND 0/3] mm: memblock: fix debugfs flag reporting and synchronization
@ 2026-08-21  2:09 Meijing Zhao
  2026-08-21  2:09 ` [PATCH v2 RESEND 1/3] mm: memblock: add missing HugeTLB flag name Meijing Zhao
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Meijing Zhao @ 2026-08-21  2:09 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

RESEND:
- Regenerate the series from the same clean base as v1. The previous v2
  was inadvertently generated with an unrelated MEMBLOCK_NODUMP change
  in the patch context, causing apply failures. No code changes.

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] 7+ messages in thread

end of thread, other threads:[~2026-08-25  1:57 UTC | newest]

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

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