Re: [PATCH v4 3/5] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

From: Pasha Tatashin
Date: Fri Sep 21 2018 - 16:14:37 EST



>>> +ÂÂÂÂÂÂÂ page->pgmap = pgmap;
>>> +ÂÂÂÂÂÂÂ page->hmm_data = 0;
>>
>> __init_single_page()
>> ÂÂ mm_zero_struct_page()
>>
>> Takes care of zeroing, no need to do another store here.
>
> The problem is __init_singe_page also calls INIT_LIST_HEAD which I
> believe sets the prev pointer which overlaps with hmm_data.

Indeed it does:

INIT_LIST_HEAD(&page->lru); overlaps with hmm_data, and before
list_del(&page->lru); was called to remove from the list.

And now I see you also mentioned about this in comments. I also prefer
having it zeroed instead of left poisoned or uninitialized. The change
looks good.

Thank you,
Pavel

>
>>
>> Looks good otherwise.
>>
>> Reviewed-by: Pavel Tatashin <pavel.tatashin@xxxxxxxxxxxxx>
>>
>
> Thanks for the review.
>