lkml.org 
[lkml]   [2021]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] mm: migrate: fix missing update page_private to hugetlb_page_subpool
From
Date


On 5/21/21 7:57 AM, Muchun Song wrote:
> Since commit d6995da31122 ("hugetlb: use page.private for hugetlb specific
> page flags") converts page.private for hugetlb specific page flags. We
> should use hugetlb_page_subpool() to get the subpool pointer instead of
> page_private().
>
> This 'could' prevent the migration of hugetlb pages. page_private(hpage)
> is now used for hugetlb page specific flags. At migration time, the
> only flag which could be set is HPageVmemmapOptimized. This flag will
> only be set if the new vmemmap reduction feature is enabled. In
> addition, !page_mapping() implies an anonymous mapping. So, this will
> prevent migration of hugetb pages in anonymous mappings if the vmemmap
> reduction feature is enabled.
>
> In addition, that if statement checked for the rare race condition of a
> page being migrated while in the process of being freed. Since that
> check is now wrong, we could leak hugetlb subpool usage counts.
>
> The commit forgot to update it in the page migration routine. So fix it.
>
> Fixes: d6995da31122 ("hugetlb: use page.private for hugetlb specific page flags")
> Reported-by: Anshuman Khandual <anshuman.khandual@arm.com>
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Muchun Song <songmuchun@bytedance.com>
> Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>

Tested on all page size configs and HugeTLB migrations work as expected.

Tested-by: Anshuman Khandual <anshuman.khandual@arm.com> #arm64

\
 
 \ /
  Last update: 2021-05-21 09:26    [W:0.056 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site