linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: <akpm@linux-foundation.org>
Cc: <ziy@nvidia.com>, <baolin.wang@linux.alibaba.com>,
	<ying.huang@intel.com>, <songmuchun@bytedance.com>,
	<apopple@nvidia.com>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>, <linmiaohe@huawei.com>
Subject: [PATCH v2 04/11] mm/migration: fix the confusing PageTransHuge check
Date: Fri, 18 Mar 2022 19:17:02 +0800	[thread overview]
Message-ID: <20220318111709.60311-5-linmiaohe@huawei.com> (raw)
In-Reply-To: <20220318111709.60311-1-linmiaohe@huawei.com>

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>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 mm/migrate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index 0ea555e4eaae..b16c561a9a4b 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;
-- 
2.23.0



  parent reply	other threads:[~2022-03-17 14:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18 11:16 [PATCH v2 00/11] A few cleanup and fixup patches for migration Miaohe Lin
2022-03-18 11:16 ` [PATCH v2 01/11] mm/migration: remove unneeded local variable mapping_locked Miaohe Lin
2022-03-18 11:17 ` [PATCH v2 02/11] mm/migration: remove unneeded out label Miaohe Lin
2022-03-18 11:17 ` [PATCH v2 03/11] mm/migration: remove unneeded local variable page_lru Miaohe Lin
2022-03-18 11:17 ` Miaohe Lin [this message]
2022-03-18 11:17 ` [PATCH v2 05/11] mm/migration: use helper function vma_lookup() in add_page_for_migration Miaohe Lin
2022-03-18 11:17 ` [PATCH v2 06/11] mm/migration: use helper macro min in do_pages_stat Miaohe Lin
2022-03-18  7:01   ` Muchun Song
2022-03-18 11:17 ` [PATCH v2 07/11] mm/migration: avoid unneeded nodemask_t initialization Miaohe Lin
2022-03-18 11:17 ` [PATCH v2 08/11] mm/migration: remove some duplicated codes in migrate_pages Miaohe Lin
2022-03-18 11:17 ` [PATCH v2 09/11] mm/migration: fix potential page refcounts leak " Miaohe Lin
2022-03-18  8:24   ` Muchun Song
2022-03-18 11:17 ` [PATCH v2 10/11] mm/migration: fix potential invalid node access for reclaim-based migration Miaohe Lin
2022-03-18 11:17 ` [PATCH v2 11/11] mm/migration: fix possible do_pages_stat_array racing with memory offline Miaohe Lin
2022-03-18  6:40   ` Huang, Ying
2022-03-18  6:59   ` Muchun Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220318111709.60311-5-linmiaohe@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=songmuchun@bytedance.com \
    --cc=ying.huang@intel.com \
    --cc=ziy@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox