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: 144653 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp1589791vqu; Mon, 25 Sep 2023 17:54:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGcHuQo9FC3RdYccC+W98Mu4VMm2PipQDEwUOEuax9TDEfRbJ5nXD8wi10MIfVGY8VMj22S X-Received: by 2002:a05:6a20:320f:b0:15d:e68d:a855 with SMTP id hl15-20020a056a20320f00b0015de68da855mr5992761pzc.29.1695689646390; Mon, 25 Sep 2023 17:54:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695689646; cv=none; d=google.com; s=arc-20160816; b=MlTMzri7944TexmYJcX3S+/+oQuQY2eBPFstE1CoP8OOPnDvX04NGuAmalnI1VspVc AHmkfbn9q/s6qZx508/JNUSfATT0/3oGExbbsrnQSE73nxz8J2qJnpx9MJKlnwlzGyGO ze3h9hw+tEgaO5fRg3oZaXSLUtRFUjfRZiHc1enNOfNv1AGlzBQlBeOTO5SGEz0hZmRw Y+KAy8QIqL2CzU7sOGD8Tq5n7yKjQVcz9N0yAOMQ9VnXiG38yo6wB+adMM9U4VQKUfoj JUwqU0c7FabDiheUNmgbv6HF5JL44sNfcQcLQYg3LagytI1sCqBVHeZWN9xnoLdz5Vvi qVsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=LSYNIqiX5/dP1JwV7wGTtypK5JC/Iahb15M57nxl0fM=; fh=FiTqiBStz9H28Qh/9rW0myzOFac7M9VOPFJTunt8oTE=; b=dyJ2CpNoUGBrMK3rygNBveRrPMobBPJZYstjYaRWVk1gYE46Ww6m3DrajrpDxaUCqh YXNvpTjeTOBoJUQ30S9UEYUB2BLru8jad2sdxgCBGooRaiy1kP3WKKi8bZS59w5rvLx4 +rPr/nGSVAOY69NY8YhhL9TncqZrLzSWgpNAoEJ6XYm7DGwIqJrNczqUwWg7WCa4VGkH ZLtN7RO+3Lp9/jy1nsCIsV0MLbrilY2MMXkjnOg2dhRdEXEg2g3Qb3X1ZQzdG6wF2bAE qxTUKEvEqh1HJOHrWCu8UUf41A0tN+ZuUCSV5iSVlQ4sfe0wQrBTkBV1Rg4nw2UIsuZJ Bc9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id c1-20020a170902d48100b001b7eb771d5esi12272220plg.527.2023.09.25.17.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 17:54:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id BA05D819D70B; Mon, 25 Sep 2023 17:53:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232712AbjIZAx0 (ORCPT + 27 others); Mon, 25 Sep 2023 20:53:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232166AbjIZAxS (ORCPT ); Mon, 25 Sep 2023 20:53:18 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C00C9109 for ; Mon, 25 Sep 2023 17:53:10 -0700 (PDT) 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-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 25 Sep 2023 17:53:41 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778059466677478185 X-GMAIL-MSGID: 1778059466677478185 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) == \