From patchwork Tue Sep 26 00:52: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: 13398585 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 9F0F8E6FE31 for ; Tue, 26 Sep 2023 00:53:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 15C7B8D002E; Mon, 25 Sep 2023 20:53:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 10BCE8D0005; Mon, 25 Sep 2023 20:53:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F3CDE8D002E; Mon, 25 Sep 2023 20:53:16 -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 E42958D0005 for ; Mon, 25 Sep 2023 20:53:16 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id BCD761A0D9D for ; Tue, 26 Sep 2023 00:53:16 +0000 (UTC) X-FDA: 81276924792.16.00C550B Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf17.hostedemail.com (Postfix) with ESMTP id 3BEAB40005 for ; Tue, 26 Sep 2023 00:53:13 +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=1695689595; 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=LSYNIqiX5/dP1JwV7wGTtypK5JC/Iahb15M57nxl0fM=; b=AK9d4HeofoZt59FvHuSSUCwMW98IZdlY6KpDdv+8A4CV+o/As/tb8ccd109+HoHbQqopLc qf9ymMJYcFekProxUpb5BSfK9qfXHZG9/H2GuF9pK3VJav7vxAPQXbKaykN65xZQ+DEnue pc9K1TCXDyEE8mrZbGmYi+/Qrbr2QE8= 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1695689595; a=rsa-sha256; cv=none; b=7IgojwaiqrfAQiN6155+nGNaXLB3Pqd9SKJ21WUIC/EXTj6dai+oQSPQp0BQYMFbwxLFD1 xtF+gXKgIkffWSmIe63Fq+HkUr7lT7VSJ8yFN0ojfe3NNj0zXpABFDPT/ZAZUXFeZHgusj QEE1wfzM2/hkRIjJ9zYSzv2o6CGJ5n8= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Rvh3Z2N7HzVlCM; Tue, 26 Sep 2023 08:50:02 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Tue, 26 Sep 2023 08:53:08 +0800 From: Kefeng Wang To: Andrew Morton CC: Mike Rapoport , Matthew Wilcox , David Hildenbrand , , , , Zi Yan , Kefeng Wang Subject: [PATCH -next 1/9] mm_types: add _last_cpupid into folio Date: Tue, 26 Sep 2023 08:52:46 +0800 Message-ID: <20230926005254.2861577-2-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230926005254.2861577-1-wangkefeng.wang@huawei.com> References: <20230926005254.2861577-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 3BEAB40005 X-Rspam-User: X-Stat-Signature: 8oj4rrfb6exrjsn4dne6wr7d4uos5fmx X-Rspamd-Server: rspam01 X-HE-Tag: 1695689593-789340 X-HE-Meta: U2FsdGVkX1/cPx7DX8jjkF/Z5o7n4H8X9UeRMUUsJhsLs6NUBvwqJt/SKckYlvhR8eaQtny7KUP9CVN1VJl3xlV0+IZa+6tZozR8S1VKL07pqSKr9boZJRfpZhg2TLXMklgRawZsyjR6Xs6xe6athaZXiQH8sTQl3ExmG1HPr63P4HofLvZGgxBCfgcVa23NI2JUu5f0wt0qMytXYMfY/PItclYjLY/xqwELCxwvl4jbI12Ycjlk7gdUBv9AiZ86XagdBaq9/ckYYqdfjBe5Xb8+W8+Oa6CtXIygrBnwK7Xwj42fQXtviFUU8/x1ynvHOkdBWY0ZgBotnufP5BBbLCCSzivD+a4jL5VUXEK7DdH9Kxqe3ff3O0KEvl1jOacekEUDBZCbEDmqURoW8vT1TxQpfUzQ2n/DR3IMhqMA5Mte/mKx2ReukXy51ivMlrjQ8AzV1WqVasTp6pyXTsfryFCgZ5wcpBfmEJvR0Ic84/c8UEl7zTOXg1bUXMxZIcd7l9qXDQKlqoxJcMOBNbOawUOO03/mtxaUJt8620LddwlUkWolA7IDPyjs4MOOKb+dyYO4hzZziivM1ZRE96bWfZVL4pSih5B8u/4SNlD0yQ4hpCv9ZWnoWCKfh8fftiqSK8y2qok83CkcMWo+Q4/r9hk34/RJp6Dbl3pviVJ2LvayJPY2+hLqX8eYNzvfo5ZS/O0HTa9PEqzrRzdDg0N6qOd+2nWIDg32fj/ri9XXU5uRyfFHm+DyNwkivWMSyDb4sK/m6EAde7+19Zt8gogLddSwdMFFwiSqRi+AMLURYPFfNiDrhvRDBMpX3OaDIG395iwH3EqTzdOLKTUv2KE1xWfn83rFbZuoM6o9TtljunYFZ1PCrl0WUC4Zzmd5aS0WqA60zn3SabDNyF6egM+QbQDIaAk5RrhcTm6wWmm03l/aizVPi3oGqHDviBUkTHZUgFKaxzmmyp+yZ4+taot 4XlDnP5z D2Uf51G5xo7Whc/WOq8BBKWTfLhX/j9V1FbxR8/K7XMWTkRbPt05qDdZxSuKkm7STReBMLvyaKvRf+GwAr5EafVakcMJ+KHxc6LKcI3u90kQaCI7cDuoG/gPfVpPOA/XK8yUJ2Bu2qbOtIpfRK6egXMGlViyl3/undHowyymMl68uSRnRwje/3nt5KWRBxXb3kzBn 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: At present, only arc/sparc/m68k define WANT_PAGE_VIRTUAL, both of them don't support numa balancing, and the page struct is aligned to _struct_page_alignment, it is safe to move _last_cpupid before 'virtual' in page, meanwhile, add it into folio, which make us to use folio->_last_cpupid directly. Signed-off-by: Kefeng Wang --- include/linux/mm_types.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 5a995089cbf5..2fdfddd8264a 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -183,6 +183,9 @@ struct page { #ifdef CONFIG_MEMCG unsigned long memcg_data; #endif +#ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS + int _last_cpupid; +#endif /* * On machines where all RAM is mapped into kernel address space, @@ -210,10 +213,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; /* @@ -328,6 +327,9 @@ struct folio { atomic_t _refcount; #ifdef CONFIG_MEMCG unsigned long memcg_data; +#endif +#ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS + int _last_cpupid; #endif /* private: the union with struct page is transitional */ }; @@ -384,6 +386,9 @@ FOLIO_MATCH(_refcount, _refcount); #ifdef CONFIG_MEMCG FOLIO_MATCH(memcg_data, memcg_data); #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) == \