Re: [PATCH v6 06/10] memblock: introduce MEMBLOCK_NODUMP flag
From: Baoquan He
Date: Sat Sep 19 2026 - 23:34:04 EST
On 09/19/26 at 10:11am, Mike Rapoport wrote:
> On Fri, Sep 18, 2026 at 04:08:10PM +0800, Baoquan He wrote:
> > On 09/02/26 at 03:31pm, Wandun Chen wrote:
...snip...
> > > +/**
> > > + * memblock_mark_nodump - Mark a memory region with flag MEMBLOCK_NODUMP.
> > > + * @base: the base phys addr of the region
> > > + * @size: the size of the region
> > > + *
> > > + * Mark the region as not to be included in crash dumps.
> > > + *
> > > + * Return: 0 on success, -errno on failure.
> > > + */
> > > +int __init_memblock memblock_mark_nodump(phys_addr_t base, phys_addr_t size)
> > ~~~~~~~~~~~~~~^
> > Is it impossible to use at runtime even thought it claims to be generic?
>
> This should only happen at boot.
>
> Allowing modifications of memblock properties in runtime is a can of worms
> I don't want to open.
Thank you. This is why I said this can't be claimed as a generic way to
mark memory region as no dump. The generic way I'd like to see is
at any time of system we can mark any unwanted memory region as no dump.
And it won't impact the behaviour of the current system.
>
> > > +{
> > > + return memblock_setclr_flag(&memblock.memory, base, size, 1,
> > > + MEMBLOCK_NODUMP);
> > > +}
> > > +
> > > static bool should_skip_region(struct memblock_type *type,
> > > struct memblock_region *m,
> > > int nid, int flags)
> > > @@ -2887,6 +2902,7 @@ static const char * const flagname[] = {
> > > [ilog2(MEMBLOCK_RSRV_KERN)] = "RSV_KERN",
> > > [ilog2(MEMBLOCK_KHO_SCRATCH)] = "KHO_SCRATCH",
> > > [ilog2(MEMBLOCK_RSRV_HUGETLB)] = "RSV_HUGETLB",
> > > + [ilog2(MEMBLOCK_NODUMP)] = "NODUMP",
> > > };
> > >
> > > static int memblock_debug_show(struct seq_file *m, void *private)
> > > --
> > > 2.43.0
> > >
>
> --
> Sincerely yours,
> Mike.