From nobody Fri Feb 13 12:30:10 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02CA4E81807 for ; Tue, 26 Sep 2023 00:53:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233381AbjIZAxh (ORCPT ); Mon, 25 Sep 2023 20:53:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232511AbjIZAxU (ORCPT ); Mon, 25 Sep 2023 20:53:20 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91A4111D for ; Mon, 25 Sep 2023 17:53:12 -0700 (PDT) Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Rvh4c62kfzrSw6; Tue, 26 Sep 2023 08:50:56 +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; Tue, 26 Sep 2023 08:53:10 +0800 From: Kefeng Wang To: Andrew Morton CC: Mike Rapoport , Matthew Wilcox , David Hildenbrand , , , , Zi Yan , Kefeng Wang Subject: [PATCH -next 5/9] mm: convert page_cpupid_last() to folio_cpupid_last() Date: Tue, 26 Sep 2023 08:52:50 +0800 Message-ID: <20230926005254.2861577-6-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230926005254.2861577-1-wangkefeng.wang@huawei.com> References: <20230926005254.2861577-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Make page_cpupid_last() to take a folio, and rename it to folio_cpupid_last() since all callers with a folio. Signed-off-by: Kefeng Wang --- include/linux/mm.h | 12 ++++++------ mm/huge_memory.c | 4 ++-- mm/memory.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 49b9fa383e7d..aa7fdda1b56c 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1689,18 +1689,18 @@ static inline int page_cpupid_xchg_last(struct page= *page, int cpupid) return xchg(&page->_last_cpupid, cpupid & LAST_CPUPID_MASK); } =20 -static inline int page_cpupid_last(struct page *page) +static inline int folio_cpupid_last(struct folio *folio) { - return page->_last_cpupid; + return folio->_last_cpupid; } static inline void page_cpupid_reset_last(struct page *page) { page->_last_cpupid =3D -1 & LAST_CPUPID_MASK; } #else -static inline int page_cpupid_last(struct page *page) +static inline int folio_cpupid_last(struct folio *folio) { - return (page->flags >> LAST_CPUPID_PGSHIFT) & LAST_CPUPID_MASK; + return (folio->flags >> LAST_CPUPID_PGSHIFT) & LAST_CPUPID_MASK; } =20 extern int page_cpupid_xchg_last(struct page *page, int cpupid); @@ -1740,9 +1740,9 @@ static inline int xchg_folio_access_time(struct folio= *folio, int time) return 0; } =20 -static inline int page_cpupid_last(struct page *page) +static inline int folio_cpupid_last(struct folio *folio) { - return page_to_nid(page); /* XXX */ + return folio_nid(folio); /* XXX */ } =20 static inline int cpupid_to_nid(int cpupid) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index c4f4951615fd..93981a759daf 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1555,7 +1555,7 @@ vm_fault_t do_huge_pmd_numa_page(struct vm_fault *vmf) * to record page access time. So use default value. */ if (node_is_toptier(nid)) - last_cpupid =3D page_cpupid_last(&folio->page); + last_cpupid =3D folio_cpupid_last(folio); target_nid =3D numa_migrate_prep(folio, vma, haddr, nid, &flags); if (target_nid =3D=3D NUMA_NO_NODE) { folio_put(folio); @@ -2508,7 +2508,7 @@ static void __split_huge_page_tail(struct folio *foli= o, int tail, if (page_is_idle(head)) set_page_idle(page_tail); =20 - page_cpupid_xchg_last(page_tail, page_cpupid_last(head)); + page_cpupid_xchg_last(page_tail, folio_cpupid_last(folio)); =20 /* * always add to the tail because some iterators expect new diff --git a/mm/memory.c b/mm/memory.c index 29c5618c91e5..5ab6e8d45a7d 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4814,7 +4814,7 @@ static vm_fault_t do_numa_page(struct vm_fault *vmf) !node_is_toptier(nid)) last_cpupid =3D (-1 & LAST_CPUPID_MASK); else - last_cpupid =3D page_cpupid_last(&folio->page); + last_cpupid =3D folio_cpupid_last(folio); target_nid =3D numa_migrate_prep(folio, vma, vmf->address, nid, &flags); if (target_nid =3D=3D NUMA_NO_NODE) { folio_put(folio); --=20 2.27.0