Messages in this thread | | | Subject | Re: [PATCH v2] mm: migrate: fix missing update page_private to hugetlb_page_subpool | From | Anshuman Khandual <> | Date | Fri, 21 May 2021 12:56:06 +0530 |
| |
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
| |