Re: [PATCH v8 02/14] mm/gup: check every subpage of a compound page during isolation

From: Joao Martins
Date: Wed Feb 03 2021 - 11:50:40 EST


On 2/3/21 3:32 PM, Joao Martins wrote:
> On 2/3/21 2:51 PM, Pavel Tatashin wrote:
>> On Wed, Feb 3, 2021 at 8:23 AM Joao Martins <joao.m.martins@xxxxxxxxxx> wrote:
>>> On 1/25/21 7:47 PM, Pavel Tatashin wrote:
>>> for compound pages but when !is_transparent_hugepage(head) or just PageHuge(head) like:
>>>
>>> + if (!is_transparent_hugepage(head) && PageCompound(page))
>>> + i += (compound_nr(head) - (pages[i] - head));
>>>
>>> Or making specific to hugetlbfs:
>>>
>>> + if (PageHuge(head))
>>> + i += (compound_nr(head) - (pages[i] - head));
>>
>> Yes, this is reasonable optimization. I will submit a follow up patch
>> against linux-next.

Realized it late, but the previous step was already broken. And I inherited its brokeness,
when copy-pasting the deleted chunk:

The @step should be capped at the remaining pages to iterate:

i += min(nr_pages - i, compound_nr(head) - (pages[i] - head));

Joao