Re: [PATCH v2 RESEND 0/3] mm: memblock: fix debugfs flag reporting and synchronization
From: Mike Rapoport
Date: Sun Aug 23 2026 - 10:43:25 EST
Hi,
On Fri, Aug 21, 2026 at 10:09:07AM +0800, Meijing Zhao wrote:
> 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
>
> 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.
I presume the changes were on top of linux-next and it's not clear how to
apply them before the end of the merge window.
Can you please resend the patches after v7.3-rc1 is out and base them on
that?
> 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
--
Sincerely yours,
Mike.