Message ID | 20220304093409.25829-6-linmiaohe@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | A few cleanup and fixup patches for migration | expand |
On Fri, Mar 4, 2022 at 5:35 PM Miaohe Lin <linmiaohe@huawei.com> wrote: > > prep_transhuge_page should be called when PageTransHuge(page) is true. > The newly allocated new_page is not yet PageTransHuge though it could > pass the check as PageTransHuge only checks PageHead now. > > Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> At least I agree with you. Reviewed-by: Muchun Song <songmuchun@bytedance.com>
diff --git a/mm/migrate.c b/mm/migrate.c index 26943bd819e8..15cac2dabc93 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1560,7 +1560,7 @@ struct page *alloc_migration_target(struct page *page, unsigned long private) new_page = __alloc_pages(gfp_mask, order, nid, mtc->nmask); - if (new_page && PageTransHuge(new_page)) + if (new_page && PageTransHuge(page)) prep_transhuge_page(new_page); return new_page;
prep_transhuge_page should be called when PageTransHuge(page) is true. The newly allocated new_page is not yet PageTransHuge though it could pass the check as PageTransHuge only checks PageHead now. Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> --- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)