[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c528e29d-c395-1651-4943-27642b9e5168@arm.com>
Date: Fri, 21 May 2021 12:56:06 +0530
From: Anshuman Khandual <anshuman.khandual@....com>
To: Muchun Song <songmuchun@...edance.com>, akpm@...ux-foundation.org,
osalvador@...e.de, mike.kravetz@...cle.com, mhocko@...e.com,
david@...hat.com, willy@...radead.org
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
duanxiongchun@...edance.com, zhengqi.arch@...edance.com,
fam.zheng@...edance.com, Randy Dunlap <rdunlap@...radead.org>
Subject: Re: [PATCH v2] mm: migrate: fix missing update page_private to
hugetlb_page_subpool
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@....com>
> Reported-by: Randy Dunlap <rdunlap@...radead.org>
> Signed-off-by: Muchun Song <songmuchun@...edance.com>
> Reviewed-by: Mike Kravetz <mike.kravetz@...cle.com>
Tested on all page size configs and HugeTLB migrations work as expected.
Tested-by: Anshuman Khandual <anshuman.khandual@....com> #arm64
Powered by blists - more mailing lists