From patchwork Fri Oct 13 08:55:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420530 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A96F6CDB483 for ; Fri, 13 Oct 2023 08:58:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 82A458E001A; Fri, 13 Oct 2023 04:58:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 78BE58E0018; Fri, 13 Oct 2023 04:58:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62BFA8E001A; Fri, 13 Oct 2023 04:58:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 4CC348E0018 for ; Fri, 13 Oct 2023 04:58:38 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 2542FA01CE for ; Fri, 13 Oct 2023 08:58:38 +0000 (UTC) X-FDA: 81339837516.17.4189288 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf09.hostedemail.com (Postfix) with ESMTP id E428F14000B for ; Fri, 13 Oct 2023 08:58:34 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697187516; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ONiFhuoJXZyIBus5P7d1IKd0msDLCi+tp53vVhwi8Pw=; b=5BdA+sWyKht52KwZg3yKy6kuR5au+H6TrDzSGBRK26CemQwra1hrn+Elow11eKC5JcbnUd HgtWA3BWu7MAS8a7SsqbPad3sX+IPyow9NFlb3StnpcDh+ahwjLjlSbzjfAI63Bj7yOpB/ cbWjnwtPETZrWocSZIX5YpZb6A3bqBY= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697187516; a=rsa-sha256; cv=none; b=Au7OhTzue0IqAtbYmrV4xtBGPW0YGQvSAve8aJ4CZH8FEUqJX+2JwbR0IVl/Mb2lk6sGGq t87PppdBLBpqDKt7L3PHkE7vneiGSXaTgrpXHUD53z/wjc3u1G1xwjpZqn0UszW9/k9w71 m3gzzhjk1K9HRL1dOGI3UdpUcPMO73A= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4S6L2J4jVLzrTR9; Fri, 13 Oct 2023 16:55:52 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Fri, 13 Oct 2023 16:58:28 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 14/19] mm: migrate: use folio_xchg_last_cpupid() in folio_migrate_flags() Date: Fri, 13 Oct 2023 16:55:58 +0800 Message-ID: <20231013085603.1227349-15-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20231013085603.1227349-1-wangkefeng.wang@huawei.com> References: <20231013085603.1227349-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: E428F14000B X-Rspam-User: X-Stat-Signature: hxkwecpnjhht6fwbz9srk9asd5texybm X-Rspamd-Server: rspam01 X-HE-Tag: 1697187514-800844 X-HE-Meta: U2FsdGVkX18CFWlypFldz/ucyDekCtzKukwBRd+/4jDf5qGi6HNbK40TQqCfgUIVwQBPmPUTADr97+mTvcWm24rC/oaISI0aaYCDwRDzO76QRcj4RdWjoO7J0MsrjJgK9GIURXz8krotTbYYzbcO0iLbfPzDthVRwDSPAX3vU0Pu7ui0PigM2D4wp7jPLBXqhzRPUXuQjdBCEnMiX2DmUV6+fPgTv4JRwdcVG+qan6PBsnhJf6F38KRtyteBIrrShJxX7m+m9yubNE86NX8khwAzLj0fjm3vESZ/YY2WA4iPkPt0bYbz3JOBZsJWwJRb0cJ13YZSwjgYvy4hJc2NxOZtjZrIxbjADM00neC/vwQuv4vT7+faXpzBN3hc79Gd/1q8aXRIRbTNGOAE/FIiz1rY7n74FSETVLXl6wOu+8gqfIZI8H646ATkxOrUgwnrDFqC3fCbp8rlG5CLGgRdnNnjA5BbJilSvrawqDLHY1ug5RjGCJyPjXm5eLyI6ALJWvbGS5RoOGbJIVN8pkLQpPZxIuR/a8H/DCF42wwVdM4MM5bZjXAgVPQ3HpoDAgSO8Ev1GzvpUo538r3msJErvLGsdfl2cGiATKiqGe3EpsextDEkTXugrmmC6/0EjDYy3Zv6aqDnqJZS515SBHop1AV4Va0rbcdnegHGo14dBYQXqWCqqLUBsoFF/YG7L0YFRFNuCUqkBN9VM3DwUl+vQ7DbU/EhtoSlilg9Pgm+Gr3r+u3h9ZeKg3Oy3MnyOdo/8Jty92Z+gYKRMBkLC3baL6BBEGg6KOG9h55QdSC/dJ6PsZt0ypog9/wx+lpIPrb32WKVozBln/eYhqiVvyRTf0oV26Gt0+ju/Jvlq2KSwNtXugRD4lwEKf5nIpmHiZdsWpG+LQnPa4rLBjeYz40uEf3kZtb86R7OXoqQIfHsRoK6+St3oOvyqrLHxgGlcPJij4tAw1OTP26a8rNhBoM SJet3cT+ 9pUXSUCr4n6AugyWUXWhZ+aO4M4IpSPMhp/FDmTkG+O0auanlUZAyp9c2GYe8GQnQiLCga5KqLUKMn5LZE5mZ83Kso/qXFZtGhbHt6AaZACLTk0pW6IwFPh4x/vfZSESAETJxyj7WE69ZLi1pgYVbXhNMePbKYmGYF/wGn0avgk/OiZKrO1BEdZH1PZwuYi+B143IMKL/Jd4mBXNF6YN1jbxuQNzIRNQ8oEyI/Cp01y5hCsw9rYDK/ApJswTv4gBMo7a4SciwNvLMCYB2i0n8719RUKv83+r0jfiv X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Convert to use folio_xchg_last_cpupid() in folio_migrate_flags(), also directly use folio_nid() instead of page_to_nid(&folio->page). Signed-off-by: Kefeng Wang --- mm/migrate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 5348827bd958..821c42d61ed0 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -588,20 +588,20 @@ void folio_migrate_flags(struct folio *newfolio, struct folio *folio) * Copy NUMA information to the new page, to prevent over-eager * future migrations of this same page. */ - cpupid = page_cpupid_xchg_last(&folio->page, -1); + cpupid = folio_xchg_last_cpupid(folio, -1); /* * For memory tiering mode, when migrate between slow and fast * memory node, reset cpupid, because that is used to record * page access time in slow memory node. */ if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) { - bool f_toptier = node_is_toptier(page_to_nid(&folio->page)); - bool t_toptier = node_is_toptier(page_to_nid(&newfolio->page)); + bool f_toptier = node_is_toptier(folio_nid(folio)); + bool t_toptier = node_is_toptier(folio_nid(newfolio)); if (f_toptier != t_toptier) cpupid = -1; } - page_cpupid_xchg_last(&newfolio->page, cpupid); + folio_xchg_last_cpupid(newfolio, cpupid); folio_migrate_ksm(newfolio, folio); /*