lkml.org 
[lkml]   [2020]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 1/3] mm/shuffle: don't move pages between zones and don't read garbage memmaps
From
Date
On 23.06.20 09:39, David Hildenbrand wrote:
>> Hmm.. I thought this is the behavior for early section, while it looks current
>> code doesn't work like this:
>>
>> if (section_is_early && memmap)
>> free_map_bootmem(memmap);
>> else
>> depopulate_section_memmap(pfn, nr_pages, altmap);
>>
>> section_is_early is always "true" for early section, while memmap is not-NULL
>> only when sub-section map is empty.
>>
>> If my understanding is correct, when we remove a sub-section in early section,
>> the code would call depopulate_section_memmap(), which in turn free related
>> memmap. By removing the memmap, the return value from pfn_to_online_page() is
>> not a valid one.
>
> I think you're right, and pfn_valid() would also return true, as it is
> an early section. This looks broken.
>
>>
>> Maybe we want to write the code like this:
>>
>> if (section_is_early)
>> if (memmap)
>> free_map_bootmem(memmap);
>> else
>> depopulate_section_memmap(pfn, nr_pages, altmap);
>>
>
> I guess that should be the way to go
>
> @Dan, I think what Wei proposes here is correct, right? Or how does it
> work in the VMEMMAP case with early sections?
>

Especially, if you would re-hot-add, section_activate() would assume
there is a memmap, it must not be removed.

@Wei, can you send a patch?

--
Thanks,

David / dhildenb

\
 
 \ /
  Last update: 2020-06-23 09:57    [W:0.068 / U:0.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site