Re: [PATCH] mm: migrate: fix missing update page_private to hugetlb_page_subpool

From
Andrew Morton <akpm@linux-foundation.org>
Date
2021-05-20 04:24:17
Also in
lkml
Reply to
Muchun Song, 2021-05-20
On Thu, 20 May 2021 10:59:49 +0800 Muchun Song [off-list ref] wrote:
quoted hunk ↗ jump to hunk
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(). The commit forgot to update it in the page migration
routine. So fix it.

...
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1290,7 +1290,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
 	 * page_mapping() set, hugetlbfs specific move page routine will not
 	 * be called and we could leak usage counts for subpools.
 	 */
-	if (page_private(hpage) && !page_mapping(hpage)) {
+	if (hugetlb_page_subpool(hpage) && !page_mapping(hpage)) {
 		rc = -EBUSY;
 		goto out_unlock;
 	}
So it uses the wrong page*, so this isn't just a cosmetic fix.  One
cannot tell from this changelog.

Please describe the runtime effects of this bug.  Please always include
this information when fixing bugs.  And when adding them.
Thread (6 messages) 6 messages, 3 authors, last reply 2021-05-21
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help