From patchwork Fri Oct 13 08:55:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420519 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 09CF1CDB483 for ; Fri, 13 Oct 2023 08:58:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 740AC8D0015; Fri, 13 Oct 2023 04:58:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6C88D8E0006; Fri, 13 Oct 2023 04:58:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 542548D0160; Fri, 13 Oct 2023 04:58:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 3E7A98D0015 for ; Fri, 13 Oct 2023 04:58:31 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 06BB9801CC for ; Fri, 13 Oct 2023 08:58:31 +0000 (UTC) X-FDA: 81339837222.04.B5F8A62 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf07.hostedemail.com (Postfix) with ESMTP id 1F5B440008 for ; Fri, 13 Oct 2023 08:58:27 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf07.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697187509; a=rsa-sha256; cv=none; b=G+xpB7X5pTjzhiegI3DgTvVjnvIcwQx34hMaP2xp/YUftSPsQwuDW5YmAEZY5ojJgU91VG RN3h4MhONc6T0YWrGU58xj49um53Sez1/Y0V0+fbB2b5A/312GpDnchM4gNkhX4hWEHksc yIwvuSpI8S2pOhZMB3UCrCVykmSmX7Q= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf07.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697187509; 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=42AZB0UhRDkADivyLQI4LDJLes6XAOA7/Y7eZodG6fA=; b=mYFuEcXdGkZLoj5FX5wUo/sjrydcTHqM1uJ2/t6GBcjJX1yygg3/puiQE9Ont4oZz4MpmC 10irEORzAjHdVhx4iFISHYtp/CYmXsoVt60vZgc6Cevhw7mlqmLIczIjj2kxG5DVqqsWUW yuhdA/lRxDc5ch+NyBj9xFgnFQ6EGYY= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S6L0d07JpzLqTL; Fri, 13 Oct 2023 16:54:25 +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:21 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 01/19] mm_types: add virtual and _last_cpupid into struct folio Date: Fri, 13 Oct 2023 16:55:45 +0800 Message-ID: <20231013085603.1227349-2-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-Server: rspam08 X-Rspamd-Queue-Id: 1F5B440008 X-Stat-Signature: hpiddjqhshnfhfjufmygdht4xbgwksem X-Rspam-User: X-HE-Tag: 1697187507-579634 X-HE-Meta: U2FsdGVkX18nyz55QL3jJinjpQhtQzHo4zw7O+oteMus/c/cZC2M6hYyxgUG4nJuVZ2nlwHbkOx/2Gl7SxNcGmEyDFgY77t9PT7+CJdazRczqg49rPC4uoqTnBtQZ+aMmpfo6lF2/SS9RJLaheFtQtd1xaOKOpVw/3WYHyhUpLdrPz2wUsrG0UeCfSVzGE+2Np73D4DhLUajdJ0rvcKRTae8vRSn2fDuwJ4JeTw2PcBG7fpeT07Kl6P3jayNcr8u7MGJ7p/4IyUTB8hSU7RNLOySBBv7Wz2eKBSl96+m6w/0jp2jbqGLwg76NmxHgWzBvVBY+4z8upKdJxxh6Fmi0lGxpFm4CENxohXDDWy/BqbHwjieF7bnchF1sAOCVx72z2NdJ1NOVeDLelOWlExu25sLi+0UpF7s3ORX/LBlWHRJKQBn5QvnP11/jMMSX67EcQufgGoZDIU+4kZuQF5dNmOGppq/1/jCrcrb44R9LRchNWFp2FQRMPfC21qzpm4ccH2s5zNoCwkGCDOXgNM+AtHIEVbReCGdE+MfVnILVApsca7/knVLpinJDg7rt8WgT648WyxhibYN85EToG5QBLGqDpgTofKdQ+aidygaitA7/BI7nXUi2bK/tMc4ir0DMMoaiAvKRj3qPjLuwGKLoTKLF9Baq0+f5EGjG+oVFAz2rQKbuZBTxrOwnNEniFec1Jy5WQ+3NbjxtvM6XA/w4Guw7Gk4QLNDQhg7T6808DNba+ivcae6qQk9gm+hV4ugPjMjzKRx6rnMUOrNl6fT5VfwrPuz7IbKIMzyYgHbHz0U9beQkZEAfrSuWGX+IsIzfd5+joGssJoOe75zKMBvVfE9l6nuk2vX/+uft6J7vKQQ8agIbmgvTQmwSZD4oP8dUXzo7GXZXmpAZ30B62joM36r8ZHCUh1CEMYzSVNv+V/hIKI5Pwhoa/Zo7w5ngNf4pwrCbkCl2036yEMkuae Uc6bVIxB pCxdCJKSH6kfhvH8dir+388sktSTJs0b8TaT43zKrPnFKN36IziqXqYjhMR1/JOlKt/9BOSTc2KfK8wttvt93TsBJc9jbc3AOPKfvzJZrRUdczylgY/b113adq8gf+RhYzRBn05L0iUJXcrXk4qW/FJaE6h1whfNQm6I/6pR2YQgNtVLKBGfUuuj0YQU3U7slGFJq 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: If WANT_PAGE_VIRTUAL and LAST_CPUPID_NOT_IN_PAGE_FLAGS defined, the 'virtual' and '_last_cpupid' are in struct page, and since _last_cpupid is used by numa balancing feature, it is better to move it before KMSAN metadata from struct page, also add them into struct folio to make us to access them from folio directly. Signed-off-by: Kefeng Wang --- include/linux/mm_types.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index cc8bb767c003..34466be945a9 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -199,6 +199,10 @@ struct page { not kmapped, ie. highmem) */ #endif /* WANT_PAGE_VIRTUAL */ +#ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS + int _last_cpupid; +#endif + #ifdef CONFIG_KMSAN /* * KMSAN metadata for this page: @@ -210,10 +214,6 @@ struct page { struct page *kmsan_shadow; struct page *kmsan_origin; #endif - -#ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS - int _last_cpupid; -#endif } _struct_page_alignment; /* @@ -272,6 +272,8 @@ typedef struct { * @_refcount: Do not access this member directly. Use folio_ref_count() * to find how many references there are to this folio. * @memcg_data: Memory Control Group data. + * @virtual: Virtual address in the kernel direct map. + * @_last_cpupid: IDs of last CPU and last process that accessed the folio. * @_entire_mapcount: Do not use directly, call folio_entire_mapcount(). * @_nr_pages_mapped: Do not use directly, call folio_mapcount(). * @_pincount: Do not use directly, call folio_maybe_dma_pinned(). @@ -317,6 +319,12 @@ struct folio { atomic_t _refcount; #ifdef CONFIG_MEMCG unsigned long memcg_data; +#endif +#if defined(WANT_PAGE_VIRTUAL) + void *virtual; +#endif +#ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS + int _last_cpupid; #endif /* private: the union with struct page is transitional */ }; @@ -373,6 +381,12 @@ FOLIO_MATCH(_refcount, _refcount); #ifdef CONFIG_MEMCG FOLIO_MATCH(memcg_data, memcg_data); #endif +#if defined(WANT_PAGE_VIRTUAL) +FOLIO_MATCH(virtual, virtual); +#endif +#ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS +FOLIO_MATCH(_last_cpupid, _last_cpupid); +#endif #undef FOLIO_MATCH #define FOLIO_MATCH(pg, fl) \ static_assert(offsetof(struct folio, fl) == \ From patchwork Fri Oct 13 08:55:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420518 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 E3CCCCDB482 for ; Fri, 13 Oct 2023 08:58:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 67C018D015F; Fri, 13 Oct 2023 04:58:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 605098D0015; Fri, 13 Oct 2023 04:58:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4A5798D015F; Fri, 13 Oct 2023 04:58:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 3747B8D0015 for ; Fri, 13 Oct 2023 04:58:30 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id EE6B91A01BD for ; Fri, 13 Oct 2023 08:58:29 +0000 (UTC) X-FDA: 81339837138.06.34A03E4 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf15.hostedemail.com (Postfix) with ESMTP id 1DDF9A001C for ; Fri, 13 Oct 2023 08:58:26 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; spf=pass (imf15.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=1697187508; a=rsa-sha256; cv=none; b=BTiJcJcTSq/9DFUrTrkYDjUkODo3lGjjAPHz2UUdvW04PGOQolM5IdKz1afY0DxZywD+OA IHqeAOg9fR4E3DSabyowcVBpwaBLuhN7ImnFFJm0e62Hg5PeFrcPjFgGRdXjov7AfFoXWy Czxx2hBACNgOTxxt4OO5XTbbHXT2yVQ= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; spf=pass (imf15.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=1697187508; 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=z3XKsRcFGkwnebwYgONpauQeYaDIMFmQ038Pa3oEk3k=; b=jzGRu+Ct7mjnKRNFgTrUo2Y8jIii/HHqjWCzS4SdTQgO9pyomayJaaoSaKi+lxyDC78c+/ f2sg1VpT5UvCc1qQr2BB9Jk1JYtCssUpd9dWqHsuq8azNTgCGVySDP+NuIy6yGLWx+th1P /d8D4TdjM9/UzUYS1aH6mjFmsRlFi+o= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4S6L295KkrzrTQP; Fri, 13 Oct 2023 16:55:45 +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:22 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 02/19] mm: add folio_last_cpupid() Date: Fri, 13 Oct 2023 16:55:46 +0800 Message-ID: <20231013085603.1227349-3-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-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 1DDF9A001C X-Stat-Signature: 3cksoh8op3nnn7t9w7nckqg6zr3pxabw X-HE-Tag: 1697187506-400291 X-HE-Meta: U2FsdGVkX18pcr7ez3g5JyArUtodI4IEfMwcH9nye89i59KkocHazPEFmDIGn/Yt/nW27YMA7WfoijTtHwGfL15CrtqFrD+e48Wt0EvbAsu7IyJwawQ9nAa7a2Eek5U5yeldtm7JTB34iWfWd30K3xLoMiqM3CgROFuZi+pjWyuVt1B6MxvgWqASYyi5bLJSl/5izl3/jqzMZyRLU9BAtwDz7o9ZGnyoK11kF2Yk9m5uzBS0R7liE7g/iUjUOza4P/zEZgmrTh4rz489pfZfOPE9YWyFvZ60yAk7HzZst9I0ODZRUrs49BHvpfOva2TzNIBzRMKXT74JNbSG2jyibjVFkGSTHKNpHnVN/DpP+q0SzhVnuHEnOeDDt1jEy7HrgZtjruNIgtTR/bWUmodwag/JuI6Pgl5UgOlSnFEFIaJMnfsNG7l1DgBLWTdB3ptRk9cfHVc6Ds7bj16AEfBS+58NSHM7izqXzTp1qDuHB00X0QQf3EQTruV20FEPkFGrA+FVs9BPqTg5p6V5FvuwcaXMIIMSHRqJM0mLx/gxHhzl40Aj2ZbdKkujlU6SBpXF5CY6mjMKJXPfFPrMvN8p9Lf7pCfibpdIl2tMSp4lzeVxtCSkl/0BeCLBA7oOwTLAiF1uAQuRGyKJnrP42W/0xhF67Rxb/ENG90b9ciL/9bxuF3hh8Cx4o+akbWvyOPqCs7gGAPvWQEgXydIqHrbwDDBoOZ7peVwELsGfR7bd00pklfIcQkmv6OvUrrlj5ZYOzmB0cJtlRW/t9y81QjG7SBXRITxB90i95hoQheV8CuGMB6v6yCObBZTszMsetwiYAHGmg5LcO2lespGBJfUY5uMhOK6FPTE77I4+361CufP+meettjsVkWc2XAWBlUeivp0ZyrU/ug9CNcQlNSssTtUcB+FauljqBjpnewWnMbG1+2rshb0SoQZngszayaaN1pIj2vkeByRbP5mqfMG 3m4h5GQH 3i6zAS3+iwDI4EMbYLMBci9jVOv+17DybMytPeNpCKqSQhSD2NLmgY+rE388pHFjU+++g9EOionsRlAx5Nn0nTx59BC1KPtpGaO8V6bXJDJ7hAN6+X1FSGuynz84YdJcEzxEblBZQA8W9AQp2KLnFlAAayWEbu7izl3tyx5LWxr7o+vRLi4q5l1mSpldoiOka5zNwrG/qjObsEyoY7UxGaoUHK7Ra3/K5M3xt+3dIrccAQxUjleXIqo27aeLJk2I4nkGauUwLo05vsbtipxADHMxmBFvh4JEw2HP5hqzUkkzSnlEddJ4jM4vQeQ== 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: Add folio_last_cpupid() wrapper, which is required to convert page_cpupid_last() to folio vertion later in the series. Signed-off-by: Kefeng Wang --- include/linux/mm.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index d005beccaa5d..1c393a72037b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1794,6 +1794,11 @@ static inline void vma_set_access_pid_bit(struct vm_area_struct *vma) } #endif /* CONFIG_NUMA_BALANCING */ +static inline int folio_last_cpupid(struct folio *folio) +{ + return page_cpupid_last(&folio->page); +} + #if defined(CONFIG_KASAN_SW_TAGS) || defined(CONFIG_KASAN_HW_TAGS) /* From patchwork Fri Oct 13 08:55:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420520 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 7A4D9CDB485 for ; Fri, 13 Oct 2023 08:58:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E95A38E0012; Fri, 13 Oct 2023 04:58:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DAA108E0006; Fri, 13 Oct 2023 04:58:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AE76A8E0010; Fri, 13 Oct 2023 04:58:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 9D3988E0006 for ; Fri, 13 Oct 2023 04:58:31 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 6DFE71601D1 for ; Fri, 13 Oct 2023 08:58:31 +0000 (UTC) X-FDA: 81339837222.28.7ED35AC Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf12.hostedemail.com (Postfix) with ESMTP id CA66340017 for ; Fri, 13 Oct 2023 08:58:28 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 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=1697187509; 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=y9mdiRTkF16A23MSwCD/zcfcV62lDhs7zm5d0Ve5GvQ=; b=k4jf+NR1IDcxOrC/6k850sIipuRrPnhwnv+pb29nWY4+FLO0vkuq3vQfzx7AePVeM0CmHV eskGjyjXOJzAmdvwhUeREWDTgJ6PqN8hIFJcsWOuCvFh4U12Z46SDqGirXxSdqxQRkkoNr Iakf9v1t75q+pDzf3k9JFpSIJI+Rsbc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697187509; a=rsa-sha256; cv=none; b=XrXx4TZqsX5MvYeceSmBcZhjaZGt3mXkLmqr/ZAsiEebFAeOXO4pc7uE7PA4KTiB1u8Ug8 ymDBsG9MjPoIqdS9t/Dp0IlhqOr3NDV1+ArQU/HR8C+5PSPabOU7rM/xQuqssfrQMsswy1 8kvRCZdELrr735PkPqTVV7HDoXB4zlM= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S6L163Z56zVlTh; Fri, 13 Oct 2023 16:54:50 +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:22 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 03/19] mm: memory: use folio_last_cpupid() in do_numa_page() Date: Fri, 13 Oct 2023 16:55:47 +0800 Message-ID: <20231013085603.1227349-4-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: CA66340017 X-Rspam-User: X-Stat-Signature: x9be8oouuu3mqypyqwbb5ef5iuuwa9zm X-Rspamd-Server: rspam03 X-HE-Tag: 1697187508-743301 X-HE-Meta: U2FsdGVkX1+V/7GEa03PNYF7+8RJcpW5eczHTrWt8LMEZUhst36bh3rCW8uwsE9OQGxcHoZYWaJwbpSUKg0KwPaOsFxEGXwMxK7o62Iv73q22+1G8vSIDnck1ma4MVxT//gtYV+h9a0kRTArDji+NSBF5MEJlXW/qJUKGH7Hguy8hcIO+kbOnmhxawKPPXR7PEvFp5Q4apifc2U5XWu3AimwnKnwY02SBZnpHWwSfg79fDHh6niDUeWkjtadkfYXMLW+/4Eg/Ixyiurc3UdA7Lu8xs+Z//Iwp6K8+kEJz9P5iIsi8uttPJAJ4VSFpm0sn0AI9U4PlvU5i4Hvv6dU1wptbccFRY/ipzxvECDbUxRWHps2JvODgI4fKBDFK+5y2mf+cb4a05L9tB/yJ0qxfJVsiTKaVe8J+MCgS38wDax1hTvEa34kQlDlPnAP3tWXjwylwSC2nwLMacMNSipuVt6/5qDOMlOMR0T5o3WuQFZfnj1Yx9E289W8Js2z6qdTq2chrACtqnVdKHIQBtfteC5ygfkejmgSqu0GAeQ7P6ciba2yOkfePMCcGZKPPcqBtvJNAWI3zP+ohOaDuMWOeGqGwnSxJhnZ20iFEufyHWcZ7+ZAubUZnqP0utBZgerUeUzuNFVvoPpa7jGMaxrQtGKx/pSrUh9hgDQLP3uJj04OzPoZLkLgCvlMmMOR9pZ2OJx6HpCK31jE8CVUv/8Z6VBHTgy2rasaSYceBcDDc36As03fPtYQQQozNNsT2O+5Hs/TWcdCiivcdBojQwKYYPSF0gMpLDP20UC4lMS3gJZpAfoUPOSU5ef7VdBVEoCLJaTV/OYy/QJ8W2SAMLbogdLH1pkvtHlQR3YrnAS835RM30yg+rPOmVkygYjoiejbfbRBkYmh+F3q9BzuvnY/Hgq/ECTpfXwHM+BvYj8E6q9OqHvOA8dp4lNqhsAqMZaZOPBORmnyRWgSq37b1CK OkQPCNoh dFRQ+iCUFT8wXg/D8lfVkdYvchRcHlropb9i3raQvc/PbDZTFf9rNhO5GMacWdTOE1lap92U/sKVfNtPep4aIAW8wv/VUcFsMbx9hPbQuBYBWCC+o3Wl9JHozfttAFrIky+8l1n/c74X9MHpSToQ1YTgaGUvrDw7CGLiJjDvETDCSo7ClVtXtO0fy+Gi5eqRBZdh5 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_last_cpupid() in do_numa_page(). Signed-off-by: Kefeng Wang --- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c index c4b4aa4c1180..a1cf25a3ff16 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4861,7 +4861,7 @@ static vm_fault_t do_numa_page(struct vm_fault *vmf) !node_is_toptier(nid)) last_cpupid = (-1 & LAST_CPUPID_MASK); else - last_cpupid = page_cpupid_last(&folio->page); + last_cpupid = folio_last_cpupid(folio); target_nid = numa_migrate_prep(folio, vma, vmf->address, nid, &flags); if (target_nid == NUMA_NO_NODE) { folio_put(folio); From patchwork Fri Oct 13 08:55:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420521 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 B74C3CDB47E for ; Fri, 13 Oct 2023 08:58:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2052D8E0006; Fri, 13 Oct 2023 04:58:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E93248E0010; Fri, 13 Oct 2023 04:58:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BAC508E0011; Fri, 13 Oct 2023 04:58:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id A0B3F8E000E for ; Fri, 13 Oct 2023 04:58:31 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 724011401BC for ; Fri, 13 Oct 2023 08:58:31 +0000 (UTC) X-FDA: 81339837222.27.2B4FC94 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf23.hostedemail.com (Postfix) with ESMTP id CFA70140026 for ; Fri, 13 Oct 2023 08:58:28 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=none; spf=pass (imf23.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 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=1697187509; a=rsa-sha256; cv=none; b=SgHX6Bqcm8eHRJvUpQm/aaye0/yXWGNuAvbPrvSxmVwvpyfMydf7s7iBuLl3/pWnDkJ40f hYGIaVKK7EcvPsLR+jpxcgNCed6cP4L+owjQHISzcsTTMX/etC4TZSiacS4csLRyGziAPt PHvX4MbUv6uCRRwwUjo+/rxe46K6di4= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; spf=pass (imf23.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 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=1697187509; 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=CXnUonKq8y+vcUdw1/au85alxquWMu9WZTGSC9Nd5bU=; b=yYhL8BlH5IZtZ81ru8sRyJvX7x3l9UVOB4PUbWZqHBJT1ZhzlqxUYmm46lFpcf9OWGrdnP mwJwbvnqbyxo3dVWd7VO8aWLzwrx1DiF7YXfb9ay8K3//Z0ZsSb7+Tp1EnbqTo00ADYtmG G5jf5LtSkGzCnTagtUgQX3AJVxRPcH8= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S6L0f4bp5zLqP4; Fri, 13 Oct 2023 16:54:26 +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:23 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 04/19] mm: huge_memory: use folio_last_cpupid() in do_huge_pmd_numa_page() Date: Fri, 13 Oct 2023 16:55:48 +0800 Message-ID: <20231013085603.1227349-5-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-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: CFA70140026 X-Stat-Signature: ih1statwbkut3aq8ddpbad5uojkbsk7h X-HE-Tag: 1697187508-165599 X-HE-Meta: U2FsdGVkX1+LAU/EKcQC4aR0/tU3tRjZfP6jIyjSN+w8DAnEi0kDh00gEHiCzvrbiWIw3inp3th/uInVdNsTTDhes/Mn6h9BsDWMD/+LIFVr3fEDdtI05wajYnUD13/8svGC6GbNL9J6lwopWGNUGDsGqPfLCnUMY7EiMc36ap1kZKncENLoSyDXmuCE4QT8Asdcy7UdJDNZAxaZpaEZ9PbEmBhfNePokIztKYxYP/O1+U5bj91xTaI9lyPwqpnr7DsEjkhWcAeZB2kXxzP643PzjAwUotH3fanQ0CdlC2R2hVH+Q6Hv1KvdyKBBak2pyKfA9O9XPTvS8vf+WlFpnUbfIIpml4b6I/2tFX65XmVi5reXcy6c3pPrNWpC3jZOQWRwy1Z7nroH3HHYs7sSpog8YQ3xTVgj81UCF2RON0ojoVKjW0L22AbsfEcxTSp2gyUYV/guTCLI1kd3rJxY1LAA85s4dtjzcgtUO6SYf0bZjJz4bddHjkcaS+jokSjS0KF2vFjysTMu02iMTTMZ9oaSk9aLaN8Ru3SmvX9KoYDbRmViGyxeipQqWwo/ZwloKhpcM5kJ6B0E7znBISNYEGVEunAS0vA3XebU7oQyWCHADXBKVQChaskJLwyc05zrW7J/V/oTZp5WN8S8Y9sUEZ3f6mwGbTCWuyOCs9rsjT9vl5/qZMf7RqTZFsAY2SFmvpkMDnXFwbCkvPNdz/Bl+uHt2EEU1ILMe/NAapvJ7voIWOeqaPWUBYXpGwNfSt0TfAu6P7WeBf1lrhr4ZKou976p8rcVIqHaPuH+4kC2m6drLPZRn0C0fCwYNzJn/yLwbhUQQ+B4gFhobcUY6W4TfD5AAhhCA7r3MYSuportzt0MrptEknBRKs80TOMne7N5X6f2thvBkOCWgkla/AXlRm2C0yNkUWNIYhMRy+Ey1T1yqiFjN1AzroJuqxmwQmgmtALy4VbKZq1RAiMBJ1H qcA6J+RL ylXW3itc1piFapeD8dixbcjA+5TSNUAmwdI05TUzc8DxKATyhjxYc04SZpck9zf+11XKrMMXWIU15ayA6L0RgnJSYbhfaxocPkfbklZtayCLW7o2kWDEy0apfmBuGr65+CAW/L9jSy2x3SnnUtajHBUO+NF2rSPBtZacUWK3qgh7pTrdYQzPUuVP+7Y4zP+hxB2E3R0eNeWYHoFBIfgiL3XJNWGvU3zWPnUpv 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_last_cpupid() in do_huge_pmd_numa_page(). Signed-off-by: Kefeng Wang --- mm/huge_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index c9cbcbf6697e..f9571bf92603 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1562,7 +1562,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 = page_cpupid_last(&folio->page); + last_cpupid = folio_last_cpupid(folio); target_nid = numa_migrate_prep(folio, vma, haddr, nid, &flags); if (target_nid == NUMA_NO_NODE) { folio_put(folio); From patchwork Fri Oct 13 08:55:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420522 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 E6BE9CDB483 for ; Fri, 13 Oct 2023 08:58:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4E28D8E000E; Fri, 13 Oct 2023 04:58:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 177F68E0011; Fri, 13 Oct 2023 04:58:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE3638E000E; Fri, 13 Oct 2023 04:58:31 -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 AEEA38E0006 for ; Fri, 13 Oct 2023 04:58:31 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 861131CA7EF for ; Fri, 13 Oct 2023 08:58:31 +0000 (UTC) X-FDA: 81339837222.27.8A05FB9 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf08.hostedemail.com (Postfix) with ESMTP id 50BBE16000D for ; Fri, 13 Oct 2023 08:58:28 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf08.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697187509; 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=0YHxzJua+p5mlcs/k2mq03WYuq2lzIWkVKq0L7/b+fw=; b=qEJYAYL/YRdqOSHi/b5XQB0w3coCJHmFa2gBTIOVsW+cdTT9AQR9mrtm5TyA7qwpJSACjR 1OsBYrSGF/+4zGa95w3whdvSbB1NEn3Ybj9C0Pt5cB0+hON5/9w/Y7gvcbGLAaarwikdAe 09dhQd84qcPKBAgqKsRZoTDIGf4evb0= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf08.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697187509; a=rsa-sha256; cv=none; b=l9qppCdE1YcsK4Yl12QnB5t1AHuzBT+MUH2lgwy4HNh2HGjYUUvlaYvuJz5ZMkQ5uspLYw 2djhq+HOuzJh8ziN2Q0TujUVBDa10NnNCgjebAJWEygYlPybv4ebYD9hA+ra3qirSh1c8t eTcnZkqV4Hh3GmdQrFX2q6IrMkPW1Rs= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4S6Kzs0xdxzvPxp; Fri, 13 Oct 2023 16:53:45 +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:23 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 05/19] mm: huge_memory: use folio_last_cpupid() in __split_huge_page_tail() Date: Fri, 13 Oct 2023 16:55:49 +0800 Message-ID: <20231013085603.1227349-6-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: 50BBE16000D X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: ugt1wefsxr1npcq4f9bng9pkc55dj99o X-HE-Tag: 1697187508-514208 X-HE-Meta: U2FsdGVkX189FR599gZv/5jE6ClpuuNK2tLEqjBzJKH2+zplGsQYPwln7EAXdQGhs1LuIvnc0luG5CNDpaCATwC0EbI64PkbpLSQnT0XOUDTPJfyp5gCp7wsKT7h3ZKuu0I6G4tessbUAcLN27ONJqk39eqQ/K8V1DTV2WKs52jPSKsL87q4Dw353HgBSgMdG85PQu/sO9RcdNMR3hY5ZgzXJhQO0xkMilJnQ9CE9GEh82V+Ehh/Mr+JMb+Y8s2FCzwxvo3gHCqA1eMl8m2RAFvd/vL1k1R36hSiwOBEnAOm8rm24e6avUFuTddKbZIpyOWYI+IXKabplBM6fSSa48c6crjT1LcHKm3BWcDA5cBkmSBNEeKBXOWUWNmqKqOQ6TQIc9PpNSJTJqIkZ3hIo56+sqIJybvmQiy7BNaYlToB4eGVypdM6XLEHhPE9KOHMu3WRF1HpYx8/FB5qUv4sNe3jYWVGfPrNvQCs11bQRAdCem0wEWdrmoO/OpPZTpj9ntEutjDnykrlSh+H57ZNe089IVLsfPXO93JLP9kdo+7LaIyImMCcx10aAzeOMSCa7ubkcABQ6KN55i9ZNt2kLwKF1SUW7zWM4oYhjAUgwL1NTVVREX8lFKbaXlrlXy06SANUQm1KhBl6fLoODno0DHpuLWkjN/zdJABl6cSOL5iWfENqyCe1viQISPcA4q1he50U+FnMJ36igcr8TgW+KCwhcQghscTSc64Bvid64PNBeslF8gOdvi60EPQs8pIoc9L2Un1q3mhjXckm3Oop4hRM41GkFqHifXt0pM3PCZ0ZDsj9bDimnoLnK2foxNShLJYiZ5XON6vMWgV1lklegC9pguDD4RO8cFghWbuJVmRiB+8WT8OyAj0AdiaktubBPPQxYwmBVuY3Pq4R4E/bC/L3jl/afSkMkzOaeMd65pGgL+oZCul0qAokgi5up/9pnP4w26dx8DRnVkdLgp +BAOgej5 RkdxKaVE81vpKhetdBItlfxTjp5Fx419Ua7uwZVCLigITKBlDWaqfF/G7UYEw01YHqiyEC1TTc0MPfMpfaK2z12WqkYXOLZN5qy2orJei2IhqEICRiCH4vBRWZmIYmAUPPd0bz2pizBU/cAx9n5qO7tCcOFASN0iq75b7U6fdaxwbmVMqj2+XmACG/UnjM6Cn/cgocn9KSplmge2tOxB1VwH+zfU0vp8C5+Gbx2K9ecRFShrBDrtQ7UV7210QDB5epLrp8KlKesZK5e2+Y3KS4t1TW54QGQymCK6m 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_last_cpupid() in __split_huge_page_tail(). Signed-off-by: Kefeng Wang --- mm/huge_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index f9571bf92603..5455dfe4c3c7 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2514,7 +2514,7 @@ static void __split_huge_page_tail(struct folio *folio, int tail, if (page_is_idle(head)) set_page_idle(page_tail); - page_cpupid_xchg_last(page_tail, page_cpupid_last(head)); + page_cpupid_xchg_last(page_tail, folio_last_cpupid(folio)); /* * always add to the tail because some iterators expect new From patchwork Fri Oct 13 08:55:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420524 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 211E0CDB482 for ; Fri, 13 Oct 2023 08:58:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 347B38E0014; Fri, 13 Oct 2023 04:58:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2D24D8E0010; Fri, 13 Oct 2023 04:58:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EDECE8E0014; Fri, 13 Oct 2023 04:58:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id D29AE8E0010 for ; Fri, 13 Oct 2023 04:58:32 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id A98C8401B1 for ; Fri, 13 Oct 2023 08:58:32 +0000 (UTC) X-FDA: 81339837264.21.BAA9EC6 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf20.hostedemail.com (Postfix) with ESMTP id CD8F11C000A for ; Fri, 13 Oct 2023 08:58:29 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf20.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697187511; 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=Ew90GRduGLuwlGQ2gfJPl9ppfNJrebvIabpuV6V4jCE=; b=7QtDZV3rGljf6Na263q2RNKxLzMs0w9U59J6Zpvt4K9skdOM1+N5ReejfHpAoHBP5fMsZF jbOvvRpzVW9p7AcAVWy6Lja6STHUtZ8E864cD/EGu+JgTnb73Z+5ao2N95K1rQFcWwpo+O shUdkoGVOXTFi379YgHKTvMJZJwJw0o= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf20.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697187511; a=rsa-sha256; cv=none; b=InCrUyCFio4JxJSocPitrMbnS0Oe3qmUMW1OwRQvh4pnmAnyF9PIsaXKKrNNJ+jBPqghx9 90R8FEg/RJLkst8QwvfBQMM+lSCJyI/a8BQQtk3UXKtyR2CrF6/JjDHUMGXubnxDtkQhSq C9c5P7dDPK646H2LOMlr7GtCl2V5BcQ= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4S6L2D0JD9zrTQV; Fri, 13 Oct 2023 16:55:48 +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:24 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 06/19] mm: remove page_cpupid_last() Date: Fri, 13 Oct 2023 16:55:50 +0800 Message-ID: <20231013085603.1227349-7-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-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: CD8F11C000A X-Stat-Signature: e6wndzt1dymogj8n1phtj6nk5ag177po X-HE-Tag: 1697187509-136811 X-HE-Meta: U2FsdGVkX1/yDhggNbKVJEOJvfIROiNqFbgeTuxSC4hLo54dkHAOf57VYuS7gT+r+Nh1KH1tmZGqj0mmmoDVMGbADwRFWnePReOggbA0mCEY6V81STDb8003TrmHVl6hSWIsAIMT2/zs5f1lfYH0jvNpI7r9ygmsO1ctet5w7ylvKqIvbRlAXRkpANAQhTrvTUUbr/pxk6dsWTBp/lWDj+XgLdO2QjaKC2OVSPAdILxedKrm16o88PEcv4rR1htnYDqmlDPULt2/2uS+FZdR/fcyoTF66/F0bs0519rfur3Xo3z0x1ewRbNVJGztjB8VBTjiH10PZZKfxlLegEhUSXPLThiK3liqqOFy+7WvvuQzJOUwUeHq2U+cFHVTWUlHRGGq9lNMZpTyh5TE5FCrYqAlqcnQra7uzcx+8exKjAvAiHKkwzDgbMBU3a7YJPx+uesm3wfk1YO7V249Yf0qyYDWNFedu3IwXMOmNKqo7SuFJHDN4qM3grXIm05Q2JuJBBRCOjnyMuEdDLBSMTt/hGUdmgsaxo6q9DKkil0V6NeqeZKNmMKlDeRF67huCBiLJMhS3rT6Cba0misAzGCcjOsNdqXJXuNcP0R2ae6bLeMxvYMCVWCKsdUrIis6IEyNYAPs4QetQj4q0Jv/m814Y4KH2Lw6fUNA19tkL0e1ZCs9rv03CPBS6BfCJAAdg9tCjPiB5NAuyOiMFPwZUc8ro3DkiCmSgeqm/NhinMcIsf/XkV3e37MrGCnmNN6ip9fT86HbBmS3pjYePoYmKXHO3O+iGRmQ2SjU3h4wfZSSkDd87Spac063kNY2wpYxGZvD1HwdP67EJMV/ijYkAbbXh1d/EdDJ1ufO4AKT+YzspnQ1LE8/im3UeuDcqZUDOU0G2rJmT1kRtnP5Rp4pBmO079DbFYZCVAOFXChtEPdGWRT+dNVMIrJsv2dV/7UKjzAvJe4YFQbT7OV2Tvvifzv vyhZiDKs gfotHRVF2clGUodi4VkqgrLTgcHNAk06UUhosdii60N6amJY3+DD386UFo7URACBU58wOG3TKeHqM+AzuK9uXvqRUjswrjPQL42X0sN1Fegl0GUbL5m+yngBM22zYeHgJ0SbWNzGRHUn0+/A7ZbC2WoQwly0KyP7WuSlbl8os9Qb8Io0wqgYRHsJo3jKECVaB7q8s0hD4I+nlFmCbcA+w22YKnsoUM5eWd9OD4b4zjyTVeu9q4DBLFN0RW32ySE6IGygYctHISW/LU0Qg4iaiRTUEWKLBJN4/am4C 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: Since all calls use folio_last_cpupid(), remove page_cpupid_last(). Signed-off-by: Kefeng Wang --- include/linux/mm.h | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 1c393a72037b..1d56a818b212 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1700,18 +1700,18 @@ static inline int page_cpupid_xchg_last(struct page *page, int cpupid) return xchg(&page->_last_cpupid, cpupid & LAST_CPUPID_MASK); } -static inline int page_cpupid_last(struct page *page) +static inline int folio_last_cpupid(struct folio *folio) { - return page->_last_cpupid; + return folio->_last_cpupid; } static inline void page_cpupid_reset_last(struct page *page) { page->_last_cpupid = -1 & LAST_CPUPID_MASK; } #else -static inline int page_cpupid_last(struct page *page) +static inline int folio_last_cpupid(struct folio *folio) { - return (page->flags >> LAST_CPUPID_PGSHIFT) & LAST_CPUPID_MASK; + return (folio->flags >> LAST_CPUPID_PGSHIFT) & LAST_CPUPID_MASK; } extern int page_cpupid_xchg_last(struct page *page, int cpupid); @@ -1750,9 +1750,9 @@ static inline int xchg_page_access_time(struct page *page, int time) return 0; } -static inline int page_cpupid_last(struct page *page) +static inline int folio_last_cpupid(struct folio *folio) { - return page_to_nid(page); /* XXX */ + return folio_nid(folio); /* XXX */ } static inline int cpupid_to_nid(int cpupid) @@ -1794,11 +1794,6 @@ static inline void vma_set_access_pid_bit(struct vm_area_struct *vma) } #endif /* CONFIG_NUMA_BALANCING */ -static inline int folio_last_cpupid(struct folio *folio) -{ - return page_cpupid_last(&folio->page); -} - #if defined(CONFIG_KASAN_SW_TAGS) || defined(CONFIG_KASAN_HW_TAGS) /* From patchwork Fri Oct 13 08:55:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420534 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 9EF3CCDB47E for ; Fri, 13 Oct 2023 08:59:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3E57E8E001E; Fri, 13 Oct 2023 04:59:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 36E028E0018; Fri, 13 Oct 2023 04:59:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1C0458E001E; Fri, 13 Oct 2023 04:59:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id E914A8E0018 for ; Fri, 13 Oct 2023 04:59:02 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B5EDF1A01B0 for ; Fri, 13 Oct 2023 08:59:02 +0000 (UTC) X-FDA: 81339838524.17.DD3B0A5 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf02.hostedemail.com (Postfix) with ESMTP id 7CCB280003 for ; Fri, 13 Oct 2023 08:58:59 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=none; spf=pass (imf02.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.189 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=1697187541; 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=MKSp5EBF6+Ov7gSZHW50N+nAf20gVCjFGTQvZhuqW6o=; b=glvfhb8FR1xm9N4oBFwtEzO3G5EmtM8ppqtGArvDiDqOu67/eNMMsXoar5Nqr6P2t7JHV7 KSTBpxm1TZgA2dsZThPt2o8jYQtlCBn4EAdeQmQpk06baGFHp/Y1iNvgkNnrAfHF5gpZRv C1y2oT1PcWmd2HZq06rWRZyJKVAs5Lg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697187541; a=rsa-sha256; cv=none; b=ndMIAkTgthRByhKervxSXH6Y8XzpQaKdRqxGs3J+eXcnhpNh3m6qr9QfIWOM770cDI+oB1 w/G1s6TQgjSY+AVFO64NDV+aH9iLNEAdjHkj2IuD4EYPYEfjHIVgIrS9qGEAZCixqsmQ/c +5fzJWYof0mIyh6C0ZIz5RTbfzpmejA= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; spf=pass (imf02.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4S6L0d3JBcz1kv2B; Fri, 13 Oct 2023 16:54:25 +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:24 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 07/19] mm: add folio_xchg_access_time() Date: Fri, 13 Oct 2023 16:55:51 +0800 Message-ID: <20231013085603.1227349-8-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: 7CCB280003 X-Rspam-User: X-Stat-Signature: eaoncxica36w97hm354rf9gi7moo9ec1 X-Rspamd-Server: rspam03 X-HE-Tag: 1697187539-377230 X-HE-Meta: U2FsdGVkX183TJeQOnxMi6B8TM33DmluUYnCtWTZ/POUA/ejYsBBTsNCUmjf+B5W9vf66lTjNxXBtmIy3lszvbRB8HIDRPpVHzwg2iH7Ft+ODZ4Jqb2+psp8L2eRB7kUjY2tNnREfe2rXuOtKK8A/5iZzHGE36WVwU8Pa6pK+66HR+fJTx9agZp1e1HLgDQYmcbuyXnTYoUwq/1iG0GcLKPEeEcKsR4aE1XxQ7OHNlrKeLebBZlTZPFD45p6y6XYhSdX5u3kIylkEb3NzDUD81iLxp8dQAyMEucSMeHqFyXiYzA0gbG+nIWgxL4etsp37QPhgCbMEup7GJJsJwG67ghCCybZifihW4YPpLMqPjcANhZSBx5wl5lw7riXEllJY6INjjr6KRq62MayCDhV1FKlc9Kyn/cNobAB3SFzQniz3v0Fzjos8ltYy1e+1vdNdgeHh9K6ZrKuOUXbSmTvxeX68kpCBmFAnJT0C0jG+RLW4RvRmvhvr7zYRv+nt/3w67/1YTuZMIoqpL8hEvTWyB/U75g8rrQPVkUPTi+L7qdStO/Pl2m6ndD99bblOqe5TE4cPFfsIGKskmq8DW3CuupFZsx20bed0ugV2qDejCCQ1HhZpuxMY1t3mPbL59AhFGzgbu96CXWgHpUugTXJMO/I4CgPEJptjZJEVClvgGRUk/+IzR4BWTGxG5flud4fOQ1CvZgHeznXdJ7agjwlBoOQMJ3OksGZnfV9Dh3OMTfKFALEMLbkzZiYz/9XkkCtmbY9Ji0haTHitKeYrJPpFJ28ohLu7rebjMHyOTK3en2ZTMiILvIsoR9HoCChVCUSn7V8sBaV0tyzF8BAjFyod7nXkAUOa3/ZJddM96Dwqohxpb8OiVO8Kqm+7h/Pj06fst7YhhchevmqN6/NJmFyGqrxlNNOt5hzpef2AEguVi4Zwnh//GIIuldebgsZEPkndHlGTTAEopLBWhQgZ01 o5pmRQhJ kgH8v8GakpsiFamCsVKJ8HY9PmbNRfdGQQCiOGP7/piL7aD4xdMU6BG0IHMWfoz7hIFXJiaSh/0jR1w2a7uNO9EWfRTPCyWVrC+P4u5iTrIgylatqW6MyRjpU0Y42nFoOYDUPZ3ngrnyYNIJtD98KZo8Bjz3vBDLPESTkOKZCdbI9VmTjsizGAy0KlEejqjGUbzGhhhtgbjwqw4WD+N5+6OCxKyvbVV6a6ttx 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: Add folio_xchg_access_time() wrapper, which is required to convert xchg_page_access_time() to folio vertion later in the series. Signed-off-by: Kefeng Wang --- include/linux/mm.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 1d56a818b212..1238ab784d8b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1794,6 +1794,11 @@ static inline void vma_set_access_pid_bit(struct vm_area_struct *vma) } #endif /* CONFIG_NUMA_BALANCING */ +static inline int folio_xchg_access_time(struct folio *folio, int time) +{ + return xchg_page_access_time(&folio->page, time); +} + #if defined(CONFIG_KASAN_SW_TAGS) || defined(CONFIG_KASAN_HW_TAGS) /* From patchwork Fri Oct 13 08:55:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420528 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 93BE2CDB47E for ; Fri, 13 Oct 2023 08:58:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 62F068E0010; Fri, 13 Oct 2023 04:58:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5696F8E0018; Fri, 13 Oct 2023 04:58:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 25D468E0010; Fri, 13 Oct 2023 04:58:36 -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 0C5A18E0017 for ; Fri, 13 Oct 2023 04:58:36 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id D315A401B1 for ; Fri, 13 Oct 2023 08:58:35 +0000 (UTC) X-FDA: 81339837390.29.1E7F3E9 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf28.hostedemail.com (Postfix) with ESMTP id 3DCE8C000C for ; Fri, 13 Oct 2023 08:58:32 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; spf=pass (imf28.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=1697187514; a=rsa-sha256; cv=none; b=LO4VJACJlDCfnBEsevy3ttmKbzKfHHR9X4S02PBxvvqET7qzAiQTBbeN8TGAgrn6QQZ/LJ Qbp4Y5U+JKZV+o1uxuNTBihO+PTJYEvw45nT3xuT1E8DugPAYSmof66b1Zs3PGpuzHKN72 uEqnsy9I2s4JaLYpE98wVZwi3C8VLFQ= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; spf=pass (imf28.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=1697187514; 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=1zLpUnjpBvurR96XU6U560Rf31eHqGYds42Z0gS0iKo=; b=hj9//y+5p6DiYOqaWrBCfjB02wnvRaRO9YbJ15vMhAQEvwjQ8DTswJJ2HD9k79/cwhS5ll MOGfoNO++ckk8MNAfGY1ylN2jve+fZCwV6jnQuzkVQwca98Kcl8Fd4HIrpQCJDquCTJ55o Xa4MdnJv/ixKsrGTjGSlUwe5ydvA1a4= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4S6Kzx4wvpzvQ2w; Fri, 13 Oct 2023 16:53:49 +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:25 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 08/19] sched/fair: use folio_xchg_access_time() in numa_hint_fault_latency() Date: Fri, 13 Oct 2023 16:55:52 +0800 Message-ID: <20231013085603.1227349-9-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-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 3DCE8C000C X-Stat-Signature: hk1qiciw7cscq6tjbj9syoagm5y7i4f5 X-HE-Tag: 1697187512-752359 X-HE-Meta: U2FsdGVkX19XjtVd6Kz90RPuMsbXu4AGqkLOwNLZ/G9jJ2gEWsOQ4pYs5Fl3VfeSfgL02FdDmeollFmNFhNbIFFr019lLRGn3WfUsU825gqRe2c5dDSSwg+y8rwvw314CWPJitgAQJ3YeNzGhvOi/AAARAPfa5JB0OjWtNynSqctrRDbrQCVGKiDk85RaWJTSB517f3z7ZfmVLMpN+OT7t20My9cyxfSiJoMJAPczPhzCnjjk9G26RmULr95vlE1RBv+ycY784lwjM8s9haqPzgTlENLIWFuuj1GmTsuq65UvCUl/NDrlXzQZTUkzTprGHkKkYs2ImqG87xlDVy2ZYriyQ0jXFDRZ5hx61zJmsK+QrZtnfN1bpJv09oq1OEgRa6HYjO+oPTp0u40aPStZdQQJVCxtU+a6XfL1BxMKA9Uvln9NS08kMgKpenEFOpmERyWNc4FaTdE97IDGYQZSaulgz2GcNt5t+K0M9/3IeW58tPTMFQwZ8eM7po0bHP29FchuEBzn8WN08vGjeI0KVKyKzMAdF1OfpgD2zBe2AnxkpNPzRtyvour4TiSvf7GBonZU0NdbAz2Ooyf87kaQsPFueATVD7CjORMKOsoqvoySXmD5SN+sT6DUBOvy9iY+wWSOpo5ExjViHqdlAPUgMwMvKewG94bjVxesXuwIOOeEv7K60fbNIe/61kFDn7IrXhGTfWsNrfjgvkoPyvtKQvhPUMpw5O8GzhuwxEE7lP4cpVbsUEYd1nubDKZvADh2/fpqYt36InD6Ti3XE/nbw43bpYKIy8Ul0i4AJ5Et0fKGbPKVuiDQtoqrDDWiMcPLxescUAM2pzdb1tvD+x0poYVUIe76+JPbHoMKoKSu7DRrEKGtpbVQEMnb4xomFABzCWBB2H7oX0mMUUChbGKHt4Cu+ZOQnsFbEAr4Xz92eu7pKRlzQkfBW0Pxwz9weJcGusY0WbJAqCENyL413D OaRXlyR1 jVx4/k4R0JmjyNLSvDup4xLOFhkb4uur8+tZ+NyNyKuUJ8vTsnPm6gFIMn+qbI3r/guXaL0COrPVU5c85gXiMquPWxZcSW6z6A/6HqNxj5DuVj2e7c+/aoAfKtHJTBvNXqID4fsv7BeOXDozkCvnBnclBe3WW2ROb01QEUUxUO6S3b9y0u4CqBxK0W3JURuPlYd17kOpDhGGREgfCnKv9yUrdP8nCcGMiObfXgxp1gzx03faxFiC1y6PYmttV0lKznrrizEZA1HXwHbErlqvFx7SPGMfCwv2/2jKctljAxsruCS72vVpxpq/7hhRMa0R/87J6 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_access_time() in numa_hint_fault_latency(). Signed-off-by: Kefeng Wang --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 78ad23fcb7f9..bc07f29a4a42 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1766,7 +1766,7 @@ static int numa_hint_fault_latency(struct folio *folio) int last_time, time; time = jiffies_to_msecs(jiffies); - last_time = xchg_page_access_time(&folio->page, time); + last_time = folio_xchg_access_time(folio, time); return (time - last_time) & PAGE_ACCESS_TIME_MASK; } From patchwork Fri Oct 13 08:55:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420523 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 9A4AACDB47E for ; Fri, 13 Oct 2023 08:58:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 93F0A8E0011; Fri, 13 Oct 2023 04:58:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 876818E0010; Fri, 13 Oct 2023 04:58:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 715AF8E0014; Fri, 13 Oct 2023 04:58:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 508688E0010 for ; Fri, 13 Oct 2023 04:58:32 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 2E5EE1CA76E for ; Fri, 13 Oct 2023 08:58:32 +0000 (UTC) X-FDA: 81339837264.24.D9E6084 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf05.hostedemail.com (Postfix) with ESMTP id E3A7A100002 for ; Fri, 13 Oct 2023 08:58:29 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf05.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697187510; 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=M5rq17p38CIoi/oLZwLhZN5sMfFvqUf+eMJ9W4f1uNU=; b=a71d9rvpLHH2NHhW+O0OybZmIZOxy1LDY7M2/pfudD9cW7iRGvJi7AIa0E6lKtZtFlF1aX TWyaXC9TqT5i3IuXKs+mv1jobCzts1uipO6zP9XdQQ81Z9oeWwwuA7if8jNRRvRt51DQMh RsbvIJgKd2jrhQGJOo2tAJQ2OslqEns= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf05.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697187510; a=rsa-sha256; cv=none; b=LZev9RBU631fpqh+VOsIY5CuGaHVAqL61DpGLE+SfsArQy0mx1E23A3hRXeIpT/9A1cU1K EMyip9y/iauRSPKtRX4PiYXYplRlkm89qxkU4QEdVzxHkZWY+jDZfcuaB44NEwu6lWdJij M9t7OE9z6qdSwhldG6Ui/wkV8MA1yXA= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4S6L2G3p2Lz15NSb; Fri, 13 Oct 2023 16:55:50 +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:26 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 09/19] mm: mprotect: use a folio in change_pte_range() Date: Fri, 13 Oct 2023 16:55:53 +0800 Message-ID: <20231013085603.1227349-10-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: E3A7A100002 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 5dkjjrszrpenhw8d6fk9ao9kox38cb4g X-HE-Tag: 1697187509-832848 X-HE-Meta: U2FsdGVkX19+we3oKUwwhVdvz+8oYWUYfqrb2o/M6gWleelSw58Da/ns1LA3HItEhTv/8UJM2TaEnbUDx8ESzwlZafhvJFLmSg4YTaKEy2OoA0o2tx2KjW5F6G5iV5K9mG+4mzVS29BqdLRm08PpTnPCTW/EYQICaX/KRuSKrD8U1iVYyVRyvLdnHV6uQwzs0DSWe/RYDG5I5ITR3qS/pc/DHDinNC8urCx/s1wJuRNW8EXlUuhSkmZ820DtZyVxJeNJ7O5v/LVDvBQE0sXPmj4AUqoSa3iSHUG6194jca29cEWBxBa7to1Kx37RXdiZjzLHTIB2FbaR+TjdNitWyrhBW1/g1FzvvF3vgJpDl8cNlNEqX2cpoQPsDJlpoEPuZ9mZKjPRdbql0YL8o3/4R8o3M5HCLPDC2JTZEpNdW2Bs/b0RCbhSUJc3jv2ODI7Ddon0soVlsT9PRqA6SwEnuaBb79CrRrh35tKuayW/ROujiFHcTnk9RYq81IyKoeE3uPYwioYM/doFRxhylYpOKF+D/jAbRzMKB8ufowsme/bfE7F8LPhQWulaC4H5dXTd9ZjKMmvJgaWW2v3K0b9zkk/jagtNsVEIMV/UUG9im0fM1RxtUVJbBzuRlYgVcOPt51uaQ7PmVIlthrkLRIwdw652dtqEpn6TmhxoXEFqIn6ASg8ZxW6lROhk7iGHugThDytjz9y0mUhS16komxS1mSONtTqZY7Ad6OqcjjKSXpZGGGt4x1isQ7pDRYLfpet0JymF4GB4VeZjhxsJSqhU7eM5zKGT2cmARe2plUT6F3zmxR6w6PeDiAv5kowMZfnxQXQAKD1tneCwCD0YbHiKJwA3ZQFd9gLJzovJJVGjgLWAY///2MHeQUdm9dogiE4o8x4X1ztjfi12cwm/06bbeyIJscWOnnsYM+M6phxaOAcMkPhG5cKtNkkSsQx4FsKI6qubweOt3eT2DkbQSDe kB945qkD gzKJJhSoMNU6r6TueAIX7B42c6YNIQgimyKrzn8X/sFG3c3zHFClZB5nhhgyAnpG55Y4o9gVCpZpUM8rIf0U+qS3dZJOp7XSNNVsXQfWEbVvww1mFP6C4ZHLasn/sE0OXoQdpxvGqKdtClnsOD4+mlaEbIKbW2ulMVhIo8/j3OcUkoJJB76k3hUn9dUNaExMM8K6C 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: Use a folio in change_pte_range() to save three compound_head() calls. Signed-off-by: Kefeng Wang --- mm/mprotect.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mm/mprotect.c b/mm/mprotect.c index f1dc8f8c84ef..81991102f785 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -114,7 +114,7 @@ static long change_pte_range(struct mmu_gather *tlb, * pages. See similar comment in change_huge_pmd. */ if (prot_numa) { - struct page *page; + struct folio *folio; int nid; bool toptier; @@ -122,13 +122,14 @@ static long change_pte_range(struct mmu_gather *tlb, if (pte_protnone(oldpte)) continue; - page = vm_normal_page(vma, addr, oldpte); - if (!page || is_zone_device_page(page) || PageKsm(page)) + folio = vm_normal_folio(vma, addr, oldpte); + if (!folio || folio_is_zone_device(folio) || + folio_test_ksm(folio)) continue; /* Also skip shared copy-on-write pages */ if (is_cow_mapping(vma->vm_flags) && - page_count(page) != 1) + folio_ref_count(folio) != 1) continue; /* @@ -136,14 +137,15 @@ static long change_pte_range(struct mmu_gather *tlb, * it cannot move them all from MIGRATE_ASYNC * context. */ - if (page_is_file_lru(page) && PageDirty(page)) + if (folio_is_file_lru(folio) && + folio_test_dirty(folio)) continue; /* * Don't mess with PTEs if page is already on the node * a single-threaded process is running on. */ - nid = page_to_nid(page); + nid = folio_nid(folio); if (target_node == nid) continue; toptier = node_is_toptier(nid); @@ -157,7 +159,7 @@ static long change_pte_range(struct mmu_gather *tlb, continue; if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING && !toptier) - xchg_page_access_time(page, + folio_xchg_access_time(folio, jiffies_to_msecs(jiffies)); } From patchwork Fri Oct 13 08:55:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420531 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 F053ECDB484 for ; Fri, 13 Oct 2023 08:59:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C96DD8E001B; Fri, 13 Oct 2023 04:58:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C20D48E0018; Fri, 13 Oct 2023 04:58:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A24DA8E001B; Fri, 13 Oct 2023 04:58:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 89EEE8E0018 for ; Fri, 13 Oct 2023 04:58:48 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 5DE7B1201B7 for ; Fri, 13 Oct 2023 08:58:48 +0000 (UTC) X-FDA: 81339837936.14.9E79568 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf21.hostedemail.com (Postfix) with ESMTP id AF77C1C0019 for ; Fri, 13 Oct 2023 08:58:45 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 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=1697187526; 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=ms2pbGLo7mG2bKDY2JPOUHEMK8SMoQKLkUCNA44AIfg=; b=IDFEY0yIS2sDy4+6Kv+KQSBp12SmVIAK2/oLPxAuO2qxGtL6MRcQaRqAxQv5Iz3HEDnrvp j6Ga5g+eFK2sji9GvALHOqMSl6xSBQp0+RiT751z94a5cJ71LJ2cj4a4as9sNIJchz8z/0 VCwrslvKMAJwOGVRvDblRGm0TbmciGE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697187526; a=rsa-sha256; cv=none; b=tJ3uxC0RSDJx+93OCkTF10tNRka8z1jY28rUigFrb1VqZr3+VSAxA4rVBq5jU/AAaHcVad TgVHLj349IgdM4c7fF9DcC2iIUD0A2X8a59IgnHLPOYkK4qaescj+CUm6rmt6qTNDV8GYd /adKexgtmQga9LFEqiBMurPxSvBuhm0= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S6L0k0jsvzLqSx; Fri, 13 Oct 2023 16:54:30 +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:26 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 10/19] mm: huge_memory: use a folio in change_huge_pmd() Date: Fri, 13 Oct 2023 16:55:54 +0800 Message-ID: <20231013085603.1227349-11-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: AF77C1C0019 X-Rspam-User: X-Stat-Signature: stm8grg6wanask3mw3kmy4sbhqwxji6p X-Rspamd-Server: rspam03 X-HE-Tag: 1697187525-774262 X-HE-Meta: U2FsdGVkX19+OG5+FQxoDgl/ken/ipIH4pTLSz0r5C+xBEQtxxJLk2COd1vNTLuZqYF1KUmTHSoApX8iY/v5w9LSvqclHI+CteuwP5q68/EdYIkPkDA4T/ZbKGwAkB31of4fqzuWQROV3GRcZ28/SxUcSH00PDQDyneYqsACeYFd4Bd2cKHjRkFtLdKRjb8R8nn5zzKSB9P355VcHUtjuMxtZkaj0lOWAKwzDzc7WJBoJduAHs1B+pYqq8BNMT7vlio0ogAqDzpAigBcaR32ENLjsjML0g3LtuGY0x/Jmzbu3+2G0XRedpTUt2vPAzm6SPOONmAUnK06SjlgFuBg1Qh3O8Nn5PtPpj/T0W3C2X1EBq4VgzR2QfeVi+7BaB/MFTaPImr+gy/Kn0ytIwTRXvHCYV1KAtpTlzx94EK4UYvf40PehGXMciSvuxIMDAPTSSJCHW5jb9DQBbNV4BVHtxngQ5rhIEPWX84Bynrq9GiWruI9jM3zCRVw/alQ9WyFuotbMPi9cz0H8iZDs0UQUvPEXJmtFtGJIcfxljoKmQWULw0cawPMq9eI0Ol0JobPdwdlovyl8KrqKkQ0zeDSDOU8oQZ/HfNPJqVJHdtf1oVK9aicrDM7C4hzs1r8gCZdw5hKoF+Go0lTiABngka2ZzCx5ykuvsBTRJd64zqadwx+V53mzhKGF9OKUSvWzRlttEd6w23HgT4EuwGFKNrBCkbwfE97RCWlgmK8n/A5Hp7EuWbDB608cLMuo6qzLiu9ZwvtxdETR/i6az6jkkYuvowNYOz4qpAl7NCpzhKCVUlr9aiFs9WfhxiWkKGJrTVLXTcNWI2JHxwzRW8NMUclYRbHGyqllyMZDIfQlL075teYBtbmrk6DBhMDUAHcK2QDe4F8cSd3AksTerPZ+XBdiQdYNapKBHNQOT7dZUmaXrhw9xPCbjgvbgW3K5/iimNW5er/rsSvVVoz8EcjVNy VoBYnRau V0LehxuAxdA11b5sIw3P4vn+KWDiwJ6ZabuPhi+aF9CSTIK44Gu6rRvrqqZa4Ro17bLTuG1fZ9XVfhASsReNZPBx2+vb9g4IkbwX/SAIqVrd4plJdUfPf/zMSlHnra9QtCXRW96fJafjsUdWKXz+k+rp2yQKzeYkpNUqUWLpUy5KA4QiYLdOpbScRmUU+q7ojIw8fnlRo8no8g2k= 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: Use a folio in change_huge_pmd(), which helps to remove last xchg_page_access_time() caller. Signed-off-by: Kefeng Wang --- mm/huge_memory.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 5455dfe4c3c7..f01f345141da 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1856,7 +1856,7 @@ int change_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma, #ifdef CONFIG_ARCH_ENABLE_THP_MIGRATION if (is_swap_pmd(*pmd)) { swp_entry_t entry = pmd_to_swp_entry(*pmd); - struct page *page = pfn_swap_entry_to_page(entry); + struct folio *folio = page_folio(pfn_swap_entry_to_page(entry)); pmd_t newpmd; VM_BUG_ON(!is_pmd_migration_entry(*pmd)); @@ -1865,7 +1865,7 @@ int change_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma, * A protection check is difficult so * just be safe and disable write */ - if (PageAnon(page)) + if (folio_test_anon(folio)) entry = make_readable_exclusive_migration_entry(swp_offset(entry)); else entry = make_readable_migration_entry(swp_offset(entry)); @@ -1887,7 +1887,7 @@ int change_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma, #endif if (prot_numa) { - struct page *page; + struct folio *folio; bool toptier; /* * Avoid trapping faults against the zero page. The read-only @@ -1900,8 +1900,8 @@ int change_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma, if (pmd_protnone(*pmd)) goto unlock; - page = pmd_page(*pmd); - toptier = node_is_toptier(page_to_nid(page)); + folio = page_folio(pmd_page(*pmd)); + toptier = node_is_toptier(folio_nid(folio)); /* * Skip scanning top tier node if normal numa * balancing is disabled @@ -1912,7 +1912,8 @@ int change_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma, if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING && !toptier) - xchg_page_access_time(page, jiffies_to_msecs(jiffies)); + folio_xchg_access_time(folio, + jiffies_to_msecs(jiffies)); } /* * In case prot_numa, we are under mmap_read_lock(mm). It's critical From patchwork Fri Oct 13 08:55:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420525 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 D3087CDB47E for ; Fri, 13 Oct 2023 08:58:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BFA9E8E0015; Fri, 13 Oct 2023 04:58:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B853E8E0010; Fri, 13 Oct 2023 04:58:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 98B898E0015; Fri, 13 Oct 2023 04:58:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 802298E0010 for ; Fri, 13 Oct 2023 04:58:34 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 5CD6B1CA7D6 for ; Fri, 13 Oct 2023 08:58:34 +0000 (UTC) X-FDA: 81339837348.06.2317CD3 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf21.hostedemail.com (Postfix) with ESMTP id 2EFF11C0013 for ; Fri, 13 Oct 2023 08:58:31 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; spf=pass (imf21.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=1697187512; 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=dav5PI7iEms8jeP4a1XhSbNqrplMPXmJIKIe/iyLzYk=; b=StlLhcIfKpsxdRrXhopoVSSE13ZOrOwfpAS1EMQoa1YDeYBYIRAXeTGYEuT3JPUqY67tMo diTaZagLgprulbnVq7Vx3bt0Pts7ztcaH4uskhrEOsPzlCYbjWKr/hEuMi+AZzpgcfMjfk DhYwNr0xKNTjVHE0pyW2tg8RI0txlo0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697187512; a=rsa-sha256; cv=none; b=uqIR7IwR2RCYCOsvzBHkH0pHlKFJmEFS/mOVjECZWvZwpo+R8HZ4VhnGJmXc8ipqaHVY62 G6r+3gYDeoCC/MY36z1D7x1lPpSneMZFcl1tK2GSaHbwTOLljhAwwIgcMMPhAqd1/SW4N2 g93Oy+xBsjNNzg6tEOTyfeAImpc6ntk= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; spf=pass (imf21.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 Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4S6Kzx5jsFzvQ3m; Fri, 13 Oct 2023 16:53:49 +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:27 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 11/19] mm: remove xchg_page_access_time() Date: Fri, 13 Oct 2023 16:55:55 +0800 Message-ID: <20231013085603.1227349-12-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-Stat-Signature: f98fjzmmtzksyxs1ispfeq9jzeem38wu X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 2EFF11C0013 X-Rspam-User: X-HE-Tag: 1697187511-125461 X-HE-Meta: U2FsdGVkX18NuaO7ECTgazFzEzRaThWV4iSdGNaOT8xVY+XplpfcyoUs1ShJFt7d2ec31mkxdDPxMaQaxYubXVcmvtqomYAEK7Zh8ZkU/iJABdix7MTZLMp/3wukWn3+DZ9yeSYg6ll/WsETHlOaeXUzgN2v5M79EGnqajDjN+aVX0oPRHxSa98IHy+XazcpSEH9g799Egk0NTGTSuZs5PI+39u2Ix/DkhAKWNGpH4omv+ygmR35Pa62wX4h+WlrI7DImJ260RgSgLGdjOf23oXp1MyU6ntME0x/A9d5XSVjO1p4sMw9oUTzJ72qKhoNz4Ae/vKBIVU2+6bP6Owd2MMjhkYAa9dntg1wCwMldptsVXeMpz1BoQ/3UASuvIovlMdnM2e313rTOZy0l6E72tKZ6NdrPnYUzdX8Nzs2FN++n+UAyVJRgJdHzGSnpcoMSkM9Hb3UYMZkPXlSHqLDDJYW2Vyc4PcqKLO0C+Upwla6zUglhBa9BfDPPiaXU/p85n4LLM+YNtjUOgVB+Pky+Pv/LtPYl9LUW/20+rXNrrDdA0KoYzB3+1p6Y4DIYW/j5Zfed8djdq7vYe700lvm38Dd4yShCykJ8BLdBLpHnWI+HG2jFwMJ6LPILsiQx0P2G8kPsh4scUbIuFAciX3KKsiAhLHz9quBdq2SpdBNv0HLeLPBmXW+oACWN8I2LBhIuuM1IJ2KZj1q4FcN2jj96/e88zGOqNTfLPBMnjrQ9aLGuUU+KoXgQh+Lc8SlRKIhyA5TwpiMjMNSltxUUPj6c0ks8psi6A7sJwPET1rs3Fu4HvjS+L0Od+WlOvOF6ZKGprvSqh3K+gRlllPOq0SK2BdG9VPonq56/gJIwE/70d7aFRBGEZ1ftIqf2X5YsqGHhFZD00K2k+e6U3u0pVm/9hVXaw8rVE9fHtgcz7pYQgftb+ME4waKRzmmQpfQ02BKOJjA+a7LO0b5JXTRm92 PzwzQywN DbAZifXKzKgL/ur+ClUkoOyvIIS8zl/8KVDlPavHFGb36s1nYdSJjdcNA+xGv0LRvRQEiVoNHbthxy9kgw6KJS3HwCH4CmTLnqL+tqA7aIdw2LWj3mjEiapEfxsML1mg9rK62SeKa4AKFebB9gpnJEq+W18t1eEgQsvpmo9gJUuFx2pSmNAmaDKIUIgcMVrVVS5iF1LqNfx/EKHxMb+PbDi2/0ztcdm3R+mMEDIVqrxndyry5DSuUg4SB0IA2qyhJI7JKhK1ZX6+Y7NSD2xX12IW14HGIlo3gEtQd 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: Since all calls use folio_xchg_access_time(), remove xchg_page_access_time(). Signed-off-by: Kefeng Wang --- include/linux/mm.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 1238ab784d8b..8a2ff345338b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1722,11 +1722,12 @@ static inline void page_cpupid_reset_last(struct page *page) } #endif /* LAST_CPUPID_NOT_IN_PAGE_FLAGS */ -static inline int xchg_page_access_time(struct page *page, int time) +static inline int folio_xchg_access_time(struct folio *folio, int time) { int last_time; - last_time = page_cpupid_xchg_last(page, time >> PAGE_ACCESS_TIME_BUCKETS); + last_time = page_cpupid_xchg_last(&folio->page, + time >> PAGE_ACCESS_TIME_BUCKETS); return last_time << PAGE_ACCESS_TIME_BUCKETS; } @@ -1745,7 +1746,7 @@ static inline int page_cpupid_xchg_last(struct page *page, int cpupid) return page_to_nid(page); /* XXX */ } -static inline int xchg_page_access_time(struct page *page, int time) +static inline int folio_xchg_access_time(struct folio *folio, int time) { return 0; } @@ -1794,11 +1795,6 @@ static inline void vma_set_access_pid_bit(struct vm_area_struct *vma) } #endif /* CONFIG_NUMA_BALANCING */ -static inline int folio_xchg_access_time(struct folio *folio, int time) -{ - return xchg_page_access_time(&folio->page, time); -} - #if defined(CONFIG_KASAN_SW_TAGS) || defined(CONFIG_KASAN_HW_TAGS) /* From patchwork Fri Oct 13 08:55:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420532 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 6FE56C41513 for ; Fri, 13 Oct 2023 08:59:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3BE078E001C; Fri, 13 Oct 2023 04:58:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 31F288E0018; Fri, 13 Oct 2023 04:58:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0FCA78E001C; Fri, 13 Oct 2023 04:58:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id E8A2A8E0018 for ; Fri, 13 Oct 2023 04:58:50 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C5DDE1601D8 for ; Fri, 13 Oct 2023 08:58:50 +0000 (UTC) X-FDA: 81339838020.30.2F70762 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf16.hostedemail.com (Postfix) with ESMTP id 26AB2180008 for ; Fri, 13 Oct 2023 08:58:47 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=none; spf=pass (imf16.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 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=1697187529; a=rsa-sha256; cv=none; b=yw3AzjrhFp3qULejMHN8S3YPjPnmHGtqDYpkAmnUL+N3LjJoSqrcxJY4NmAEXaBwsZfxMJ oICq1+z9WQHDyVeEuEyOHUtFT+EEUhN/ZMXzU7cgO68bc6xuE6Oe056bn8e9nEdEUVftQG cSgG3ab14sxMGFouSGtj9/A/sEkTdTY= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; spf=pass (imf16.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 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=1697187529; 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=DNlrD185RwWjuMxj0G5WMekXxP2MZsx6AcQ/7SuQlaE=; b=u5SylyRqKWOQECNOT53xCNS8cPWlg2i6T2GkuwWiLPmPkfSfDaOhzORlqbgalmZbVxyYdK cQt0Lx2JrcKqKFzrTZzHmllqZEhufjKVxcR+/L/X1LheHEfa8dhspgpfwux7zvWYbc6Qyy UlxX7+pJiFdwEzxUu60vrbh7Dnt+L90= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S6L0l1jcqzLqXJ; Fri, 13 Oct 2023 16:54:31 +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:27 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 12/19] mm: add folio_xchg_last_cpupid() Date: Fri, 13 Oct 2023 16:55:56 +0800 Message-ID: <20231013085603.1227349-13-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-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 26AB2180008 X-Stat-Signature: g6qkt7fw58eskkhkc48rid8e4jdxhchp X-HE-Tag: 1697187527-460834 X-HE-Meta: U2FsdGVkX1/YWAy7IQ6L9TvwOiUcWlAgT9tWopa5iQA1l7BK+0mMowwP5iXvCuVEARPw+5yrKzzEELSYpfNEVaSpqdsVsccMfGOyBkpmpnNqJs4s30I3ECsdey6YOLzb2wXWLRQrjwQMD64X+GDHj0Ec27mqeqj1oJKkA361NIwnWtYWnS15dZ8JdBIX1M8xV4YfqAap/+dfu9awrZy2L6bQY+q0kU63dV5UAZtC5LsxtVqSjak7IxaJyaJOpUjQ9YcbxTKRNiJrtKK6OC/Fqb0YZ4/OY7lELBXCRSz1FBHm+0wq5m+WKbq/HGk1h+Z3HY/idzTBaaOS1r4l2zd/IV0IuQ++ef5UbUp8UjgepsL/C+hgStulVQ6z14hDKave2UvN9JWoZ61HTyOiKGVaFoD90H+PkuV/Ssq0EzxaUu+Arl4zv8F2FzAj2rPPrr7LETK++ql9dUVALxgvltjB76LWBq6AiDQ/UZgK03IZVOOAn1nk1J9udhYMOPhjJCuM8QV7aRHs06rifjHfZuuWUVtfXQ+XycqavG4HhcrrtZShnw8Yj2O7HD6hvzgm7X67BvhUSsbcwM9X/Yg7DCa0Os6Rb3UC54iLXVy6QRts0aB0gD2Xu4QriGmhKyeUMqH+5t92zHSW8RHU7WbxRmbzsQmMHbL1TiN1JRIOEsQ/OEg+0M+a7vnWLIqYpKi6P8LgDIO53PGjdUW+0tW+MKbdd9IdY63nedRVPeHanf/ymKSA/AW+eF/MImxvMMR6CiXAxdP7rFAZIKkWr/JZYMfiVHsrtSeiAPuJZWE/J6T62ccCbh/RgF7SEWO+5FzE9Znu/JTn6ys1xNlA9P8gwdMUYQWyO44fUSv5XZ3eA+KemOdns9spAjh9UE8nORwuYzFQuePCcDn1ZEW8azihmTE4/wFYoGE0xe4FM3/HA4uxOMgnX3E7fE8Eqo79h8xppbnegu35EhA4xwfGimQWf9j 5h6GEeyZ KgvIGHZfmkozAR93MXub4Fjtx32Cb0qKDiYIHvhr3h9i7dmcNd4iD2cZJ/gVtg8OOKJa9eiytoYADYAm8oyIwNxjut4MknUU2roEgCDtKQJ450dQtcnBvJa2SHXfRXHlO3SzDkOOaY6ZDthdr9PXASwZE9Wt3cgpp0Qv1yD6W9yyo4Ht9qVSi5NDZfCx/2lZzPOvZ4jNcxTAz+7+FGbzwloAX4QybmBShdiym 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: Add folio_xchg_last_cpupid() wrapper, which is required to convert page_cpupid_xchg_last() to folio vertion later in the series. Signed-off-by: Kefeng Wang --- include/linux/mm.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 8a2ff345338b..8229137e093b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1795,6 +1795,11 @@ static inline void vma_set_access_pid_bit(struct vm_area_struct *vma) } #endif /* CONFIG_NUMA_BALANCING */ +static inline int folio_xchg_last_cpupid(struct folio *folio, int cpupid) +{ + return page_cpupid_xchg_last(&folio->page, cpupid); +} + #if defined(CONFIG_KASAN_SW_TAGS) || defined(CONFIG_KASAN_HW_TAGS) /* From patchwork Fri Oct 13 08:55:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420526 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 659D2CDB47E for ; Fri, 13 Oct 2023 08:58:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AC2028E0016; Fri, 13 Oct 2023 04:58:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A25448E0010; Fri, 13 Oct 2023 04:58:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 84FB68E0016; Fri, 13 Oct 2023 04:58:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 6E1588E0010 for ; Fri, 13 Oct 2023 04:58:35 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 39E251401BD for ; Fri, 13 Oct 2023 08:58:35 +0000 (UTC) X-FDA: 81339837390.03.DDE58D9 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf01.hostedemail.com (Postfix) with ESMTP id 0C55D40013 for ; Fri, 13 Oct 2023 08:58:32 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf01.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697187513; 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=0k79eWN2qPWQalXNVxOZ5DtGxynTd8wYPB9G+6CYZjA=; b=F1/9U/FKVZVUtQ9q6f8RKYXyQfQJIOsOWqPsnXcdsAH/4e/bII7P/KOJP+g/p5xqGRNe95 NaAhZWZFFbx4I4t2xpY76/yyMQW+RODNpDLux5FKx7r5m37EsDUZimP2RgFd0Qv48Jg1s5 1+tyBfh0sNPZGiflHgW1Wquo8V8EqVU= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf01.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697187513; a=rsa-sha256; cv=none; b=lyS9cYCdZiVEC40KhBd6bTr6ldUjMWJ3fCkiUMtBnzAGG5BcmJBUM8gecNS+xdcYGmpyVF lgt5gIw2mECLnCMM8EYrnBAKaeHpTMNTaR8jnd2UYIMlM45J/9WKtI4Iv2+ncF8G9iifNv 7F5Gg0gZ/M23xdrmykGceNClBqof3YQ= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4S6Kzx5LBgzvQ3X; Fri, 13 Oct 2023 16:53:49 +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 13/19] sched/fair: use folio_xchg_last_cpupid() in should_numa_migrate_memory() Date: Fri, 13 Oct 2023 16:55:57 +0800 Message-ID: <20231013085603.1227349-14-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: 0C55D40013 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: ox1cx7tjdhahgojsgjag8hsxwat93h88 X-HE-Tag: 1697187512-489677 X-HE-Meta: U2FsdGVkX1/b1p5R2LlXKVd6TB0xnVUt4h1TnpraZnR2jUXEh9yS0zosBEdmTPmeXkg50Rh5o0+UMMjfaciLIHoy2Qrd+noigkjofHhpmBYr64hCs5+rsPiKOAZYtCarmbuLIAsUJWo29T1CYB3J+JQBoQAhv9PgJ+XoZob6K6I+CYGqKX1HVd/AByPyMFB1WyPcLGeqLRAN/R6pZ61DzSb39eXQMtAJ9HwyQP03ks+DeYSufRMqZigDMBh8FWUaiteqqcHEpCT7Z4Z8ab3vBvzOaoYe32s91yGE6Btm2AtDemuexmM3ffVzVyRBDqj6/lmI5dHQ5a+f5QvYxGCFAQ7IMPA3xF2lxLnntaxidDCROJwHar3bxeuEQFV4LpltCTSPLEzsMdQNr0gWbnLy7Oi/a62WIXjs2EIDFuKwlGJtRe+Gk8nCB7Fhyhzw8qdioAegsyJPUTc/s6JJ1wACOmmnsvSqN90q8sKh+oYsvFJYRKnsfHxUU4tpeC9Dyo/pgoy5rJ4k0Lo4QAePSForg8bSsw1SwuPZJEP9oj+FMBurHR3CjSsGbO3DxOSmRPsp4fHaRrIfujDzdRidXBGTQKUD0kpeuRLLkW15urVIlQVkoO5RRULaLmHkkGA212eGctzhQDshC9+0PqdguUn8pbA1UT0yF/Kf5fZJbTlGUTs/6tt+9ue5dX/A+i9QZyTPZxw3nyUmbx6U3IdyQLz9gk/LN+ZbKbPZhQshtcTFfd83+v08t0mKmQnP6dFa3qhOKCHQBIdeX9qZ+pBdv5bMvurtNHKsWdcdLLOaJkQqD5fXa1xzq6cMA3dV8YHItvJ5x67lHLKsCy5KAXw671/AawXyEgq4po/XtHoo7oymwq/+Ua2JY7Qbr/OPTZQkYZj8qg5uIHxBFMvPyaJhrce7c91gL51Yc86vHpehdg8KivkQOvnFYh1IX24Cd6uIQafmw9pen2VeDBYG/dxVlTd 1zUmWylq NXJ5seZbAh3cw48DzUwRQZ671i7g0PlrqCecUnQbjOI+P8b2K2QPyafgO4NHgFJOCOqCWhV3TFMlofDm5CA91YNVy0ciGyAuWSYKZ5J24PB1Alw7n+CkkfgGuYwqVJI7FPcUcKZyI4qtIJfYGyFg045EGfMSddfGz4vU94bEENC7S3h+EoI/78cs7uP8GU7AXCwi7n4YrOT2hMhQMjKIm6WQeI7oPUKkGWfI8UeTYFCQCtBnrRjHPIU614tgswHFsvag/Axi1JCxhzj3SLvo5aS+v180UMn+R6Gqu 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 should_numa_migrate_memory(). Signed-off-by: Kefeng Wang --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index bc07f29a4a42..f3cb4c8974c5 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1862,7 +1862,7 @@ bool should_numa_migrate_memory(struct task_struct *p, struct folio *folio, } this_cpupid = cpu_pid_to_cpupid(dst_cpu, current->pid); - last_cpupid = page_cpupid_xchg_last(&folio->page, this_cpupid); + last_cpupid = folio_xchg_last_cpupid(folio, this_cpupid); if (!(sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) && !node_is_toptier(src_nid) && !cpupid_valid(last_cpupid)) 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); /* From patchwork Fri Oct 13 08:55:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420527 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 E2646CDB483 for ; Fri, 13 Oct 2023 08:58:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 260788E0017; Fri, 13 Oct 2023 04:58:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 178808E0018; Fri, 13 Oct 2023 04:58:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E69D78E0010; Fri, 13 Oct 2023 04:58:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id CD3458E0017 for ; Fri, 13 Oct 2023 04:58:35 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id A9109801CA for ; Fri, 13 Oct 2023 08:58:35 +0000 (UTC) X-FDA: 81339837390.01.02613EE Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf29.hostedemail.com (Postfix) with ESMTP id 940F612001F for ; Fri, 13 Oct 2023 08:58:33 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf29.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697187514; 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=J7hLCzxP+vfH5k3zHwo4He37UOBmYzrfi4mtBVqDm2w=; b=5Mv6c0ZLRKXUSDelneS4TvjKQ9tpH0OeqsWez1wp+vyQ4f/Vxlbw5sXm6OTuj8Y3txZlDn qzLRFPOLGjyhaKG5Bha8QOakpxGywAJ0h+2CYlytaj1DRp/6At5NvITrNmV38Mx+tfRi53 9BHU4ZPkup63b+siKvki/IF6EHgJYHA= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf29.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697187514; a=rsa-sha256; cv=none; b=Pa1jLL/twiIGZfnJ3cDJl7hk9AfjKu8qPOAZAmdTDMQpa0dFiNyXjAFw8D7ILR6tZ/1+6R oIB2V71ECyi3NChvVj7TCRabiOaP+VUwyrj3tPqjJGA4L6Lg7WPWfpwnl4aA2DysTt3WeD /B4kHzxEEbHMgmYPK4Bw2psp0yJwWh8= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S6L1F2x25zVlVS; Fri, 13 Oct 2023 16:54:57 +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:29 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 15/19] mm: huge_memory: use folio_xchg_last_cpupid() in __split_huge_page_tail() Date: Fri, 13 Oct 2023 16:55:59 +0800 Message-ID: <20231013085603.1227349-16-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-Server: rspam09 X-Rspamd-Queue-Id: 940F612001F X-Stat-Signature: 8ho4mu5th1niis5wa8wxnehpfgckceta X-Rspam-User: X-HE-Tag: 1697187513-687360 X-HE-Meta: U2FsdGVkX19fkXCvmPhJ/3v6etADr9XFZ/eSscPC9l/iU25zNwFhv7jqGwYqrg84XjmEJlDW40Bbb1NPrYCeFyN7sih/9M5jv+MW12NQ8yuAUzA5YGA/SLra4rDM0KtbYp7YyA0c0VbyQ7IVipTjISUeYo+k9d4nlpa5BCew8tywmqLcMj5RQdUQ5cWkBg6mluckR+YgFGynFhTsxsNHa6C5NWFzodkhmgM6HB8GGixfHa+wFTGY7L1hkkhMQF7wWiiuETFfW4TEBS+AxCv8dymNPF7twGt2ijEYA1dGS7InRayBelxW5XV/3NW+yxqb2mvDGlT1aMwIfySTrJ8Uo/JaPXQQZ8WfL4GkEdVirWI6639i/wWblQpTkjC0Ew0rz6MgJgsL3picc1kj1h70an9Do1AYsvKCAecSjSvdDiMxn7ExmEQztjAIcX+WmN4QUd2O8Hs8M3BHQS5e8aEyU+B7VDa9yNsc+l2T4KbUsSt3aLKQAeeHSi/XVnkMRoZowZUhOinXtN0M4IP7kdZnRUlGc17PYU4v6p4YlI8GB4cvICvjPeOH50IpcdIwUKwse96fcGsI8X4SSKz94ON+5B+feVC/MJjopGHZs6n2JcOPpHWnxw5xmrdYUkwyaiTW1TtUK98PyQwJj/EHsgxv/9ANjM8t3YzQKvwpXhojhsTj/zQtwTlT4u9qpz6VaOUk6JataFkFKEG5vXG7dcEs2aRvZBbzbX24FegesFacc9SGPWSzYtB+G5dEJFDf9vnI0UDWY/MaEqGd2HJb89AYiBy+9d1+e/IRtyhonHLRkZqpsblo3h0j7MzzhBgMPpFbfJ1Od1DeBjOCOcrk7yb+KW+8zvaa+3zbYFTpziWO5gr/+gW5VC7cN3WelnxAyDcFfdIOroD+3aki/bYO1fZuYyG1z2vrqRj9LqLSjHst5x7HNb02S4aMff7yV2ilLC/1MTOy1q21GhlgEhRd389 wH2aEFrr f1IRpP8EsgEAuA29SR1x3NjrV3OpPn1CuQ6lbuY4XEQKjqzw1VgiAtilHI8eVbeXv5TcrwTvt5Iyzi0+kJW7ozob4M9bH9INMMcyUtx4PrkZ4uZAG6skgr1Sfezt35SBYfpbvWBYLyC2uq4WwfLsqucdra530ZmComArTJoYn7IufY423JU+/7FJCX/IWwl3dbHaP 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 __split_huge_page_tail(). Signed-off-by: Kefeng Wang --- mm/huge_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index f01f345141da..f31f02472396 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2515,7 +2515,7 @@ static void __split_huge_page_tail(struct folio *folio, int tail, if (page_is_idle(head)) set_page_idle(page_tail); - page_cpupid_xchg_last(page_tail, folio_last_cpupid(folio)); + folio_xchg_last_cpupid(new_folio, folio_last_cpupid(folio)); /* * always add to the tail because some iterators expect new From patchwork Fri Oct 13 08:56:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420535 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 E02E2CDB47E for ; Fri, 13 Oct 2023 08:59:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BD3948E001F; Fri, 13 Oct 2023 04:59:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B5EAB8E0018; Fri, 13 Oct 2023 04:59:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9FE1C8E001F; Fri, 13 Oct 2023 04:59:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 7D1B48E0018 for ; Fri, 13 Oct 2023 04:59:06 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 309EC1401C3 for ; Fri, 13 Oct 2023 08:59:06 +0000 (UTC) X-FDA: 81339838692.28.0BC583B Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf08.hostedemail.com (Postfix) with ESMTP id 8846A16000A for ; Fri, 13 Oct 2023 08:59:03 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf08.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697187544; 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=MUSi80tZ4yNk8CECWcRvMJAQ5YmLm4C/rY6QQ6q7lE8=; b=s5HOGV6NA23d1FWMTKOKgEA6esZ4jFLUJehgxr48+rxZTAEoV7wFQ4rEThetBOTXG2Znil GO7TB2w9cc1Gca9WS1hq4JJvCJ91UyR2a+1Ml5ISDHkjSoL11hW1bPBiptM1xygodd2EyT XKUe3eitgzsKDMIUITc2EZojnkwBZI8= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf08.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697187544; a=rsa-sha256; cv=none; b=hyna9DXhEIOaYeAQxB0PU36KVIz5hDUJVXKHAfO7SJV5mbE0NjJTyGLL8iAJBXuUaDMzaJ J/w2wamgLaVsFyNDmMLkJReZGXpWQ9FxUM8lfpo79A15gU0fVaPjL75byemgesuIhrhyqf jig0FoXdrb265qiU1WRnSGkaQAiyAxc= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4S6L0k4qGFz1kv2n; Fri, 13 Oct 2023 16:54:30 +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:30 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 16/19] mm: make finish_mkwrite_fault() static Date: Fri, 13 Oct 2023 16:56:00 +0800 Message-ID: <20231013085603.1227349-17-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-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 8846A16000A X-Stat-Signature: ghpfqhfbfrqjzz6d3m37sdrqtp4ookuk X-HE-Tag: 1697187543-964262 X-HE-Meta: U2FsdGVkX18XLTzgKHaY/KBjjdH0BSZHtaA0TRdx5Evf36sWWLMKXue3yUPFIobUdL09L4YCuAOCGtg/OTPu31D2rXNN6VmCqfxyhNE4XYPevnP3FOKuEd+3Yw3F9BtfI2EHHyViMoPhjDKHBS+Eex0zNeu4LccurazBuDcRGlkC9i1ZE55uGR99bvIMmu3z7NJXxe58lq5Bv6gNGbKQfkgoUYthbC9WYRdIIwtQmakLO7Xfdk3Ri2jtuJGEw+xvq50MDjFZrzr8Pv/ZfY4SqCqviETxuYexy2bEwVdL+qYRleOW6JzTOKMahr+QIP/dhonSH6W1qtRT5iFHcKiRPxnICVKo8vOeFdKhdc2z/PppgSgNzAi+xpgUFS5gNtSp4ojb+Wbo+0mswASKk/GixgSfQZ54Qv9Q9O7ZPhoNS9ffirJYlZumvsGcYaCN6y4AQuGPNgNp3HHdm/ugto4ckP3FHZryGON8JydGoqn860cXoUJ7uWABmZJk9R2YTPs9K9Es2a3Mw0AWyQvdg3H42KQtzYSUj2isMLLHZN50yEIJOhTcoy2QpQOtkBxKEDhm2xaSQyYKmgIvyUh+NWNkmauXeaNgcbQMVABCRUCJ5eVWoHQM1G6o/gQIsh5DK01i2JMx5pkeFnd9uR8G+jPodAIWyuE4lB3gfjqobVbRgk8QkzxQ2ptrsZ6T0YtyDaigcRl75QYRDbAgybakSKSdMnadxR9l7Y7GX3wLIVf63hzfUlI1ffnkKp/4ic26O0A1vmToNYdm1elhZ7vCFl5//zXpZ6+PbyjHQLzZybs7D3ITRB/J4ZStJW/w2Q8S5bc2Pyv0yHMNHCug7ShttaVtupwjm8w2iGPJvN1/3ydH9dYSYx5y6NScNRSUrLCI6hCDSR1LtPvV2AugrCtjBDBszm8TFy98hExPJK2n+wBwmbrelmjdFPcoZfirwAOguwrPPkmNz9Ydkl6acs38izS Cbvv8lsg iq0Ok26DZgud9d1jeCJqBtiiONT37wp3AFPYiuG6IX6K9GsRGIFd1mVWbTSgf8vuwybF/VsEvePay/Zgr8PpfLLkqT6uMpipzKOZpsYy1Afx605zcL7gHgzUSzTMEqtJxdd3mKsUtbYMbOOvHB7RHyydSaYZdcjm63u+g+frkiHqZjA5iN6dRnG3AADUQkamhIfWMt4qckuKu0Ko= 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: Make finish_mkwrite_fault static since it is not used outside of memory.c. Signed-off-by: Kefeng Wang --- include/linux/mm.h | 1 - mm/memory.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 8229137e093b..70eae2e7d5e5 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1346,7 +1346,6 @@ void set_pte_range(struct vm_fault *vmf, struct folio *folio, struct page *page, unsigned int nr, unsigned long addr); vm_fault_t finish_fault(struct vm_fault *vmf); -vm_fault_t finish_mkwrite_fault(struct vm_fault *vmf); #endif /* diff --git a/mm/memory.c b/mm/memory.c index a1cf25a3ff16..b6cc24257683 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3272,7 +3272,7 @@ static vm_fault_t wp_page_copy(struct vm_fault *vmf) * Return: %0 on success, %VM_FAULT_NOPAGE when PTE got changed before * we acquired PTE lock. */ -vm_fault_t finish_mkwrite_fault(struct vm_fault *vmf) +static vm_fault_t finish_mkwrite_fault(struct vm_fault *vmf) { WARN_ON_ONCE(!(vmf->vma->vm_flags & VM_SHARED)); vmf->pte = pte_offset_map_lock(vmf->vma->vm_mm, vmf->pmd, vmf->address, From patchwork Fri Oct 13 08:56:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420533 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 D6A63CDB47E for ; Fri, 13 Oct 2023 08:59:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E6CB38E001D; Fri, 13 Oct 2023 04:58:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DA6FA8E0018; Fri, 13 Oct 2023 04:58:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C46A28E001D; Fri, 13 Oct 2023 04:58:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id B11418E0018 for ; Fri, 13 Oct 2023 04:58:51 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 8D31EA019E for ; Fri, 13 Oct 2023 08:58:51 +0000 (UTC) X-FDA: 81339838062.02.29275BB Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf17.hostedemail.com (Postfix) with ESMTP id 1631640005 for ; Fri, 13 Oct 2023 08:58:48 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 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=1697187529; 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=cXGe+ZxAMCbzmhr4nz4OXGUo6DR8hOC6Ngyljy3RdKg=; b=TyaP38drOUuWdukEcbEuIPBgvlEgIBf3obKtUH7ofOAHe3bh7y4/MEEDd0M1y717OjoSI4 IsrH1BBW5QC5C15KFkpavJUO6UrmUD+TT8DZFYsN72nuK6+iShMJd7bLD2bNFlSDI6S0QC WEn/7NRnR3Lhv5ag6JJKU71n/katEds= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697187529; a=rsa-sha256; cv=none; b=npqYPw+lcQjFprQaqoyG7Vf0nGIABLjLkWRzpbo6GyIMuHaKexxvQ+CLf+TSp9fYfqIByB vtmEEP20HhluFBLO9gleMJByEq0ZFZmvFqqdZoru/fVEhYYeqBjXIUbBj+lgdHM6t5cJfv BGZM9hSHh0JzE9kGHL4mgjJM70rf5F4= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S6L0p19gNzLqNj; Fri, 13 Oct 2023 16:54:34 +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:30 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 17/19] mm: convert wp_page_reuse() and finish_mkwrite_fault() to take a folio Date: Fri, 13 Oct 2023 16:56:01 +0800 Message-ID: <20231013085603.1227349-18-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: 1631640005 X-Rspam-User: X-Stat-Signature: 3dwuig5jgeqwzbabgobs4f18oa7uc6x6 X-Rspamd-Server: rspam03 X-HE-Tag: 1697187528-646479 X-HE-Meta: U2FsdGVkX19cFYvJd09C9Fo1D9gHDHBtauStPyjL+BnbiECu/5+VLOMdjAPw2UtspVBKd7QIxqPZQQGdzF7oTHPyWWr0LuWKUwuEECDA5MxNEAcX8uhpm3KYn81ij883wQ18Whrec5aar30CQHI46O6KFsHqWPNUjiF/NpqVc+PK0S+RYl+cIDKMlZMNu6i9tkNWWw4LvwVwYCeVpu4x22cST8AVUBhJtlMhTs+yamI4HjmZCwCottNYnIcMziXnGpSuJpSncEVeSL6JXpyLerQji3tDxuRO99bNziJwFMek1TmZpW/AlX+DkcRS1qOdaaJhvJEiNuhLyHFlHQnrnBe6qfBld49HDtes2oUQXSsXDAFSfueZuqm+8BMyHWh8YJAIEq/jsesuEGsUSieKGYoWeHv5GaDCYDO5LgKAUTFLVBStVhDYsgGZPj1fWLZyLDlzuCgBdBwoZk994095ehaCNBS5G8PpFLYaCaso/PmW2nLKAXBJu/5YWVGUlfp/mFeMKj6JhX49zoK4IsO0XLx3WqxFrlnfvTpfXEO+18+G+UvGg20emWMuy7QDdQWqSit4Umsrp/kabaejd0rm3kH6X/bl4nBmUmpleAdkOPjAfQuLSP8xWKNM+cdh2u7bB2CGyvc4Z/uaJKr/a5NiWTwIoFLYzgFdgZfZH7D1mtdExlbyOfTxfwOVr99LmQFVurqzJB0jo3RFWTJQBeYVZ+wTxHRqU0PL+Jo6aBhk/wk5qDBXb35jsgNr1m+OwpSWc3E+nFQdlvQAz6iHDQjSpaz/8XPz4ARqf1I0nc/slqMFcXE36R3ng15vyhFiSIU95RGT3gl4tSwv6aJKlG7O+0lPjh7EX6IaAxnZnOrYnutc2ssxd1L4NYpfpxQ5tU7y1yZ5a9y6b84lGIRoU2VTz05FfNS6MoNgekdMRHTdZmpTzbXLJiArGEg8lq1GFHy5OjkyNhHId5QH+VUIAeO 7wtZPXgP wiCLLl7kyxbrjEUSSs4m7ZZ2q9dP8fPxbl53DfKzOxnNkxHOUOiOxko0fULjbhBbAqqDC/XUbiCCrvjDyKR7IStXdJU/XTozEU7gnqtMn7TglTqzQgLhmwGVdvr7cCpF1EabaZ8jeON5JkQcDxP+qnmR9keyetX81LhZh+U3ROnmr+9oIK3+mWwXtHG1D4P29nx9/cSrS18OvRd8= 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: Saves one compound_head() call, also in preparation for page_cpupid_xchg_last() conversion. Signed-off-by: Kefeng Wang --- mm/memory.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index b6cc24257683..6b58ceb0961f 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3018,7 +3018,7 @@ static vm_fault_t fault_dirty_shared_page(struct vm_fault *vmf) * case, all we need to do here is to mark the page as writable and update * any related book-keeping. */ -static inline void wp_page_reuse(struct vm_fault *vmf) +static inline void wp_page_reuse(struct vm_fault *vmf, struct folio *folio) __releases(vmf->ptl) { struct vm_area_struct *vma = vmf->vma; @@ -3026,7 +3026,7 @@ static inline void wp_page_reuse(struct vm_fault *vmf) pte_t entry; VM_BUG_ON(!(vmf->flags & FAULT_FLAG_WRITE)); - VM_BUG_ON(page && PageAnon(page) && !PageAnonExclusive(page)); + VM_BUG_ON(folio && folio_test_anon(folio) && !PageAnonExclusive(page)); /* * Clear the pages cpupid information as the existing @@ -3272,7 +3272,7 @@ static vm_fault_t wp_page_copy(struct vm_fault *vmf) * Return: %0 on success, %VM_FAULT_NOPAGE when PTE got changed before * we acquired PTE lock. */ -static vm_fault_t finish_mkwrite_fault(struct vm_fault *vmf) +static vm_fault_t finish_mkwrite_fault(struct vm_fault *vmf, struct folio *folio) { WARN_ON_ONCE(!(vmf->vma->vm_flags & VM_SHARED)); vmf->pte = pte_offset_map_lock(vmf->vma->vm_mm, vmf->pmd, vmf->address, @@ -3288,7 +3288,7 @@ static vm_fault_t finish_mkwrite_fault(struct vm_fault *vmf) pte_unmap_unlock(vmf->pte, vmf->ptl); return VM_FAULT_NOPAGE; } - wp_page_reuse(vmf); + wp_page_reuse(vmf, folio); return 0; } @@ -3312,9 +3312,9 @@ static vm_fault_t wp_pfn_shared(struct vm_fault *vmf) ret = vma->vm_ops->pfn_mkwrite(vmf); if (ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE)) return ret; - return finish_mkwrite_fault(vmf); + return finish_mkwrite_fault(vmf, NULL); } - wp_page_reuse(vmf); + wp_page_reuse(vmf, NULL); return 0; } @@ -3342,14 +3342,14 @@ static vm_fault_t wp_page_shared(struct vm_fault *vmf, struct folio *folio) folio_put(folio); return tmp; } - tmp = finish_mkwrite_fault(vmf); + tmp = finish_mkwrite_fault(vmf, folio); if (unlikely(tmp & (VM_FAULT_ERROR | VM_FAULT_NOPAGE))) { folio_unlock(folio); folio_put(folio); return tmp; } } else { - wp_page_reuse(vmf); + wp_page_reuse(vmf, folio); folio_lock(folio); } ret |= fault_dirty_shared_page(vmf); @@ -3494,7 +3494,7 @@ static vm_fault_t do_wp_page(struct vm_fault *vmf) pte_unmap_unlock(vmf->pte, vmf->ptl); return 0; } - wp_page_reuse(vmf); + wp_page_reuse(vmf, folio); return 0; } /* From patchwork Fri Oct 13 08:56:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420529 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 68C03CDB47E for ; Fri, 13 Oct 2023 08:58:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C1618E0019; Fri, 13 Oct 2023 04:58:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 14AF88E0018; 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 EB93C8E0019; Fri, 13 Oct 2023 04:58:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id D6F5F8E0018 for ; Fri, 13 Oct 2023 04:58:37 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id A9E0B401C0 for ; Fri, 13 Oct 2023 08:58:37 +0000 (UTC) X-FDA: 81339837474.16.43CA858 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf05.hostedemail.com (Postfix) with ESMTP id 7EF88100003 for ; Fri, 13 Oct 2023 08:58:35 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf05.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@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=73qbkeRYK0UwEo09b8YO/gA+ZBZX23AWTiCUsRN78/g=; b=EaLanMra6F3WEOEve/4esEedIbbCpPNuPuftnb532baEoQur8piWE2iGqW5uFmFpFB1OYJ wDoht6zqf31+qxA0wtj4TIQrEh7Ag2LTNOtSCT/kkXI6oTi13FLYTxQ0ROycdmcPBFXLb1 VzEz6B8heJWNurJm86rEQ+4+FL+9ujs= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf05.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697187516; a=rsa-sha256; cv=none; b=vMwLzXJQdaVBLBrT7Bx2VxJJaw2eYfgTM3qbzXOogCEyuZbUDxzkEi2tJoBfDK97OyR1/F T2wyZFcg0miggjC+oYjYSGjlA6eGY/oiABtbc0XDQ6M3qdYDvr0yKrfXTrysSDzmG77YSL XICalWtZmTTvDj4YLQInB8STZDVOeqM= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S6L0p5GHyzLqXs; Fri, 13 Oct 2023 16:54:34 +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:31 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 18/19] mm: use folio_xchg_last_cpupid() in wp_page_reuse() Date: Fri, 13 Oct 2023 16:56:02 +0800 Message-ID: <20231013085603.1227349-19-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-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 7EF88100003 X-Stat-Signature: mxctgxi8tf9jqmd6zas1tqm6ykactr4w X-HE-Tag: 1697187515-168954 X-HE-Meta: U2FsdGVkX185+ZZeorPtn6cV2yZUDwxkjNsYQJonlY5j/NSpiRUW+/208My9INlD7lmbb4LT1NyFl4xDRB3AEAHbcu2AKf1ZDhzA9QB75SF7DhFjXN+ltPSuOQm/VK1k9/Dcr+RXFBktIUBGvPcaaq9n4gbPXP8N8atqeUtvNi4P8OtW37o/P1+5K/WZUuv9QWmh1zaBtLzUcYXwBQB2Hy9CqmtAkJ4e4+WhRU1bviTOTZB8SuJD+u6BmrlPpoQ+VBfjZbLSYyOfqZgWI574V4hO93FG7P3h0ZNGgOva1nfjVFCxfpGXN6L9g4/CTVXkDwimwraOxDhxN5ewgmpW92ZIhtczemCz/4x0r/J+4t7tmRvhIyBgiP+eMUgmOJk/FtNXm7AZ3yDitISUflCgOcDQfgUYfOJ4ZrfT2WJl8pb+oLRVzrhx6XbTKLrvxbs5Wu+ulgEV03iC67+mUdIBr/Ty7nQKALNCHn1LcHXSA5RKpn22tMCu9bxmCXJK6+7b2BNn8Ulleu6k6SUC1DovD6W4cdKzdvu6tvlgra9OIHUyzxyEMpe+/CG3GcXnT/lFRXNMyg46bVRWq+7Y2DxoKLIJpzQzT05I2CTzJg6/1ctsMmDXBlZmJCZQlP/Y4kyN0fUnn/Bo5G/wQ2SHBHv9XtjHuySgbkhM4V0W/UjX/mUzBXICRewv/8UPfHQV4Yolwcb2/O7qBorhR2C7Pye2h1F/GQs2oYcUDnGJORzIIO67oZILQWYM8dJzKf5bB7cz8fhS0xsMHueAfN3hIfQY4787N1lr7msMqDSt7PV+nSlM0E26DhrvF55s98d49uJDAaDdsOjmiltkc8uy5T7YkQ1iYXdPmtUtKeFguS2jtpBj2GT04RmwY9INBxXaDJ43HDUQKKCp8gnadwZLywilOrFNN5nELiiiMdkNkIKoQMeGtJkEHdSTjae693Wm0QCvcfUbyF+TW6dgRfu2isy AVQQ9EVS WkIU1GcN5+PyQGMheHLZtTKp1PlCKPGc8T6XL65VEpzSfTCR0xGkmTeWsMCeqvPb7Cmvssr4I75/KkBH1hoVfopo2w81eCN6cEZZQJcBJGzH8qxAwQ7Nr2qE2YgbpqM5FI+tGsdsIRSVFNd6IVauP/05B7+cj5pMkwwa/jca/mH0O79hXo3RuchGt0YS/lH+PJ+vZ 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 wp_page_reuse(), and remove page variable. Signed-off-by: Kefeng Wang --- mm/memory.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 6b58ceb0961f..e85c009917b4 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3022,19 +3022,20 @@ static inline void wp_page_reuse(struct vm_fault *vmf, struct folio *folio) __releases(vmf->ptl) { struct vm_area_struct *vma = vmf->vma; - struct page *page = vmf->page; pte_t entry; VM_BUG_ON(!(vmf->flags & FAULT_FLAG_WRITE)); - VM_BUG_ON(folio && folio_test_anon(folio) && !PageAnonExclusive(page)); - /* - * Clear the pages cpupid information as the existing - * information potentially belongs to a now completely - * unrelated process. - */ - if (page) - page_cpupid_xchg_last(page, (1 << LAST_CPUPID_SHIFT) - 1); + if (folio) { + VM_BUG_ON(folio_test_anon(folio) && + !PageAnonExclusive(vmf->page)); + /* + * Clear the pages cpupid information as the existing + * information potentially belongs to a now completely + * unrelated process. + */ + folio_xchg_last_cpupid(folio, (1 << LAST_CPUPID_SHIFT) - 1); + } flush_cache_page(vma, vmf->address, pte_pfn(vmf->orig_pte)); entry = pte_mkyoung(vmf->orig_pte); From patchwork Fri Oct 13 08:56:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420592 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 74DB5CDB47E for ; Fri, 13 Oct 2023 09:35:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0E9E980014; Fri, 13 Oct 2023 05:35:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 09A3A8D0015; Fri, 13 Oct 2023 05:35:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ECAE880014; Fri, 13 Oct 2023 05:35:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id DD7848D0015 for ; Fri, 13 Oct 2023 05:35:08 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id AA11CB4B83 for ; Fri, 13 Oct 2023 09:35:08 +0000 (UTC) X-FDA: 81339929496.30.CCCA160 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf02.hostedemail.com (Postfix) with ESMTP id 26B0E80024 for ; Fri, 13 Oct 2023 09:35:04 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf02.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697189706; 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=KMKcdjwd08Xk8ND6ULlLoLx+XBYNhLeLKyS742C9v9I=; b=BRKCX6a8tP4H8X1ue/B4mT4NUy2jX4zE7iJmytkOv34I43H1K190yZJflkCtBFw7GkV6qK 0+q9lNE7sfShCgNxH/YSR3dtimj9QrVRs3ByPWaFV+/zMQGUmrQMt0wBStwhrPy3unQDt+ BtROcyJk5kQmXDkHHulIEu6O/l9Tum0= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf02.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697189706; a=rsa-sha256; cv=none; b=52y8TkGJcVSH+lJy2p7QshcTeJXI2Idl5efa+z7806mE7De/gKVG8bVNoEbk1XMH5kYlIf VwTnIhdefxIHw1svUrz2+gbnV/ac+y5FrBqE51F6sVfKBIIoZ547GCJuArj9e7V8WVnsA4 13mijl4JazAO9FRjwLjjCoJsVwuz9e8= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4S6L2M48t8zrTQw; Fri, 13 Oct 2023 16:55:55 +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:31 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 19/19] mm: remove page_cpupid_xchg_last() Date: Fri, 13 Oct 2023 16:56:03 +0800 Message-ID: <20231013085603.1227349-20-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: 26B0E80024 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 857tuicto4xc33qdwyekr7pt88oxgjbk X-HE-Tag: 1697189704-73299 X-HE-Meta: U2FsdGVkX1/XnwDelIEp+nHzdcIE+MUqkvc1F8MLStcUxeXUZNKo0QSp6GdcBzhoV2++Svn0THz0lMLkWVUnyZ0rTA3vbo7Sg2FPfXZFWgx4A2AF7U8HOVxVEJWHPWFU/B3WsfS913XN+fN5mXOB8yK8ND5E+CULsE2UkL3qF/Qa7+7f3KRkK72yflh5l4WrUN+XH3rgj1KWYGNdkngmvb4Ou63Tjb0/8VHa/w9vvuBoE7uIYfBQrFflEHpvZmmV6+oTC6RHPzUmadyijZ9+LzI2juosBuJ8rcqgTd9oH4Sz6C+oYT7mOgTrfdsiWO8JRYtdSScL2aZ2r8lroEUJ+wZaRfy2FrEa8EL2qOu04tbLaSWuhb8wDVXXPaGb56BWyB+h+eIwOqvvsEhbffPbmxlrqn9FtJv2P95B4A2c4X1v3T9IU/EaJAmRdImGonJZQ696evKPEJknqL4a683vYMX7FUIVDjp9VOkQ8ArV9C3MCmJHN8FpXbV3lNHzAtw7m0napZk1s4M4D+eoMcJkpqPQt/7BUtcMMAMGSt/oYLD7ej1B5A5l15ejZJ/CnFKkYU5GSK6q7rK7onnjRAQWq7R+Bx/x2crqjjVdyMpaNNkAMS86JBnQJJmrCwMnrU5bX0YvxiVCX9egvJyALpl4ZACl4M9XRno7uvRckt1FN8EMPHQbFTDHExiOsM0XGFtHBuQtE2yHhfoMpbjrCSK01xtMReH7Ja0QkUv68YdhZrPg/THCgA7wX//iGxDEIZ6R154q/lw8KNQzl/D9/s1RUVH23kL/9gKbSQaNnLb3OuPkxL40Ych9jyhUj89sxUfGA0POB3PH15cmn1D1jxo+rjTA1HwFbmql+pGyiTfehHdD54yMQxWBD6zap/KWegnP8xkdQnnkT5ZvVYdUBUHfwVPPqGz2OLwrX2/OmUR6cyB7IVcxaZW58DG9GNe+oJ/g7Zx9g+gysB+k+8n34Q4 qWr1fJ5G ppjUT4PZXMPM0b7DpvhdLL4tt8tBF7FYowSCv0D/++Qx+73nsN4wrYR8uRW2CdQstODVZiSiEDYwEfEZIv+XUS0V4nj1aJgI7PL/wV0KkA2TzGWTe476/dLlBKmLVTKBhX+b/MzFIhc6KTHGABsoNLtBk9J6EgeczK3mMsd3ppPIesBVjv1pQ7Tz8ffssRhhRX16gcHQMURliGvJjmoOCxv1pwUDqUrhFxVpTqTsTNHyPCT+qZCtBvRWjqG/KZQv157xRHWxEJsT8KcAIRJM9uwSAMHjPoilinAP6 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: Since all calls use folio_xchg_last_cpupid(), remove page_cpupid_xchg_last(). Signed-off-by: Kefeng Wang --- include/linux/mm.h | 19 +++++++------------ mm/mmzone.c | 6 +++--- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 70eae2e7d5e5..287d52ace444 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1694,9 +1694,9 @@ static inline bool __cpupid_match_pid(pid_t task_pid, int cpupid) #define cpupid_match_pid(task, cpupid) __cpupid_match_pid(task->pid, cpupid) #ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS -static inline int page_cpupid_xchg_last(struct page *page, int cpupid) +static inline int folio_xchg_last_cpupid(struct folio *folio, int cpupid) { - return xchg(&page->_last_cpupid, cpupid & LAST_CPUPID_MASK); + return xchg(&folio->_last_cpupid, cpupid & LAST_CPUPID_MASK); } static inline int folio_last_cpupid(struct folio *folio) @@ -1713,7 +1713,7 @@ static inline int folio_last_cpupid(struct folio *folio) return (folio->flags >> LAST_CPUPID_PGSHIFT) & LAST_CPUPID_MASK; } -extern int page_cpupid_xchg_last(struct page *page, int cpupid); +int folio_xchg_last_cpupid(struct folio *folio, int cpupid); static inline void page_cpupid_reset_last(struct page *page) { @@ -1725,8 +1725,8 @@ static inline int folio_xchg_access_time(struct folio *folio, int time) { int last_time; - last_time = page_cpupid_xchg_last(&folio->page, - time >> PAGE_ACCESS_TIME_BUCKETS); + last_time = folio_xchg_last_cpupid(folio, + time >> PAGE_ACCESS_TIME_BUCKETS); return last_time << PAGE_ACCESS_TIME_BUCKETS; } @@ -1740,9 +1740,9 @@ static inline void vma_set_access_pid_bit(struct vm_area_struct *vma) } } #else /* !CONFIG_NUMA_BALANCING */ -static inline int page_cpupid_xchg_last(struct page *page, int cpupid) +static inline int folio_xchg_last_cpupid(struct folio *folio, int cpupid) { - return page_to_nid(page); /* XXX */ + return folio_nid(folio); /* XXX */ } static inline int folio_xchg_access_time(struct folio *folio, int time) @@ -1794,11 +1794,6 @@ static inline void vma_set_access_pid_bit(struct vm_area_struct *vma) } #endif /* CONFIG_NUMA_BALANCING */ -static inline int folio_xchg_last_cpupid(struct folio *folio, int cpupid) -{ - return page_cpupid_xchg_last(&folio->page, cpupid); -} - #if defined(CONFIG_KASAN_SW_TAGS) || defined(CONFIG_KASAN_HW_TAGS) /* diff --git a/mm/mmzone.c b/mm/mmzone.c index 68e1511be12d..b594d3f268fe 100644 --- a/mm/mmzone.c +++ b/mm/mmzone.c @@ -93,19 +93,19 @@ void lruvec_init(struct lruvec *lruvec) } #if defined(CONFIG_NUMA_BALANCING) && !defined(LAST_CPUPID_NOT_IN_PAGE_FLAGS) -int page_cpupid_xchg_last(struct page *page, int cpupid) +int folio_xchg_last_cpupid(struct folio *folio, int cpupid) { unsigned long old_flags, flags; int last_cpupid; - old_flags = READ_ONCE(page->flags); + old_flags = READ_ONCE(folio->flags); do { flags = old_flags; last_cpupid = (flags >> LAST_CPUPID_PGSHIFT) & LAST_CPUPID_MASK; flags &= ~(LAST_CPUPID_MASK << LAST_CPUPID_PGSHIFT); flags |= (cpupid & LAST_CPUPID_MASK) << LAST_CPUPID_PGSHIFT; - } while (unlikely(!try_cmpxchg(&page->flags, &old_flags, flags))); + } while (unlikely(!try_cmpxchg(&folio->flags, &old_flags, flags))); return last_cpupid; }