[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cfd46177-16b7-7eac-0845-41109552044a@oracle.com>
Date: Thu, 27 May 2021 14:12:21 -0700
From: Mike Kravetz <mike.kravetz@...cle.com>
To: Michal Hocko <mhocko@...e.com>
Cc: Naoya Horiguchi <nao.horiguchi@...il.com>, linux-mm@...ck.org,
Oscar Salvador <osalvador@...e.de>,
Muchun Song <songmuchun@...edance.com>,
Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>,
Naoya Horiguchi <naoya.horiguchi@....com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] hugetlb: pass head page to remove_hugetlb_page()
On 5/27/21 12:54 PM, Michal Hocko wrote:
> On Thu 27-05-21 09:28:51, Mike Kravetz wrote:
>> On 5/26/21 4:52 PM, Naoya Horiguchi wrote:
>>> From: Naoya Horiguchi <naoya.horiguchi@....com>
>>>
>>> remove_hugetlb_page() dereferences page->lru, so it's assumed that the
>>> page points to a head page, but one of the caller,
>>> dissolve_free_huge_page(), provides remove_hugetlb_page() with 'page'
>>> which could be a tail page. So pass 'head' to it, instead.
>>>
>>
>> I believe we have the same problem later in the routine when calling
>> add_hugetlb_page()?
>
> Can we ever get a tail page there?
>
Yes. Actually alloc_huge_page_vmemmap() and add_hugetlb_page() calls
later in the same block of code expect head page but we pass 'page' which
could be a tail page.
>> If so, should we combine the changes? Or, do we need two patches as
>> the bugs were introduced with different commits?
>
> If there is an issue then I would go with a separate patch.
>
The calls to alloc_huge_page_vmemmap() and add_hugetlb_page() are only
in Andrew's tree (and next). So, they can be fixed there.
I'll send a patch shortly.
--
Mike Kravetz
Powered by blists - more mailing lists