Re: [PATCH v8 01/17] memblock: add MEMBLOCK_RSRV_KERN flag

Pratyush Yadav
2025-10-14T13:10:43Z

On Tue, Oct 14 2025, Breno Leitao wrote:

> Hello Pratyush,
>
> On Mon, Oct 13, 2025 at 06:40:09PM +0200, Pratyush Yadav wrote:
>> On Mon, Oct 13 2025, Pratyush Yadav wrote:
>> >
>> > I suppose this would be useful. I think enabling memblock debug prints
>> > would also be helpful (using the "memblock=debug" commandline parameter)
>> > if it doesn't impact your production environment too much.
>>
>> Actually, I think "memblock=debug" is going to be the more useful thing
>> since it would also show what function allocated the overlapping range
>> and the flags it was allocated with.
>>
>> On my qemu VM with KVM, this results in around 70 prints from memblock.
>> So it adds a bit of extra prints but nothing that should be too
>> disrupting I think. Plus, only at boot so the worst thing you get is
>> slightly slower boot times.
>
> Unfortunately this issue is happening on production systems, and I don't
> have an easy way to reproduce it _yet_.
>
> At the same time, "memblock=debug" has two problems:
>
> 1) It slows the boot time as you suggested. Boot time at large
> environments is SUPER critical and time sensitive. It is a bit
> weird, but it is common for machines in production to kexec
> _thousands_ of times, and kexecing is considered downtime.

I don't know if it would make a real enough difference on boot times,
only that it should theoretically affect it, mainly if you are using
serial for dmesg logs. Anyway, that's your production environment so you
know best.

>
> This would be useful if I find some hosts getting this issue, and
> then I can easily enable the extra information to collect what
> I need, but, this didn't pan out because the hosts I got
> `memblock=debug` didn't collaborate.
>
> 2) "memblock=debug" is verbose for all cases, which also not necessary
> the desired behaviour. I am more interested in only being verbose
> when there is a known problem.
>
> That said, my suggestion is to only dump extra information when something goes
> wrong, not affecting the boot time neither boot verbosity.
>

With your proposed change, we only know what the overlapping area is,
but not who allocated it. I don't see how that can be done when the
error is detected. memblock debug lets us know that, which is why I
suggested it.

--
Regards,
Pratyush Yadav