Re: [PATCH] mm/spase: never partially remove memmap for early section

From: David Hildenbrand
Date: Wed Jun 24 2020 - 04:04:16 EST


On 24.06.20 09:48, David Hildenbrand wrote:
> On 23.06.20 17:18, Michal Hocko wrote:
>> On Tue 23-06-20 17:42:58, Wei Yang wrote:
>>> For early sections, we assumes its memmap will never be partially
>>> removed. But current behavior breaks this.
>>>
>>> Let's correct it.
>>>
>>> Fixes: ba72b4c8cf60 ("mm/sparsemem: support sub-section hotplug")
>>> Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxxxxxxxxxx>
>>
>> Can a user trigger this or is this a theoretical bug?
>
> I tried to reproduce it, but somehow I get unexpected behavior.
> With a hacked QEMU I can get
>
> $ cat /proc/iomem
> [...]
> 100000000-143ffffff : System RAM
> 144000000-343dfffff : Persistent Memory
> 144000000-1441fffff : namespace0.0
> 144200000-144ffffff : dax0.0
>
> After
> $ ndctl create-namespace --force --reconfig=namespace0.0 --mode=devdax --size=16M
>
> I get
>
> $ cat /proc/iomem
> [...]
> 100000000-143ffffff : System RAM
> 144000000-343dfffff : Persistent Memory
> 144000000-1441fffff : namespace0.0
> 144200000-144ffffff : dax0.0
>
> I can trigger remove+re-add via
> $ ndctl create-namespace --force --reconfig=namespace0.0 --mode=devdax --size=16M
>
> So we clearly have an overlap between System RAM and dax0.0 within a section.
> However, I never get early_section() to trigger in
> section_activate()/section_deactivate() ? That's unexpected

... booting the correct kernel I can see the printk's I added ... I'll
continue to poke it with a stick.

--
Thanks,

David / dhildenb