From patchwork Tue Oct 10 06:45:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13414874 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 E6270CD68ED for ; Tue, 10 Oct 2023 07:07:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 66F308D00AD; Tue, 10 Oct 2023 03:07:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 61F3B8D006D; Tue, 10 Oct 2023 03:07:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 50E288D00AD; Tue, 10 Oct 2023 03:07:31 -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 3DF6C8D006D for ; Tue, 10 Oct 2023 03:07:31 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D9A021401B5 for ; Tue, 10 Oct 2023 07:07:30 +0000 (UTC) X-FDA: 81328671060.24.D06366F Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf29.hostedemail.com (Postfix) with ESMTP id 4EA5E120022 for ; Tue, 10 Oct 2023 07:07:26 +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=1696921649; 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=0xbzl+RRPO9YDRU0w4/UNxHSJngCPUgSKYZLF88odr8=; b=0q/PSUcmQqFQn53CyoDeWGTlFZoUPK3WuZS1YNPCY5VR75niDWzpQiQSPZA6v3u9Lb10OZ WNk/dNY++I+hysGWMxv9tNDJhZ52ODX55K5r91CAU6QN2mQFTdLgylJguKfCc/Sunnb/to Fz77km7A3SOwwS/YG9KFpcJo80TVgr8= 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=1696921649; a=rsa-sha256; cv=none; b=0qRwkVHcxujv07Oti29Zfwep8LWOWvn9nBCVBjPVhTcjJaCy+X1EZlzgIoVRcoe65ce9sh beIEIkNdFVI1mJNmI//C/9LNUokcWg36xVEQ7hC8rNmktJjUEpmT3JcujY8IxBpaHWmgva ItNg+RqfBIRHtj5YkFqgYeQF0e8RDxY= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S4RDZ0Y2gzNnmZ; Tue, 10 Oct 2023 14:43:10 +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, 10 Oct 2023 14:47:05 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Kefeng Wang Subject: [PATCH -next 1/7] mm_types: add _last_cpupid into folio Date: Tue, 10 Oct 2023 14:45:38 +0800 Message-ID: <20231010064544.4162286-2-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20231010064544.4162286-1-wangkefeng.wang@huawei.com> References: <20231010064544.4162286-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 4EA5E120022 X-Stat-Signature: dfz9stn7c664yjkedsefan4unfonkuiu X-Rspam-User: X-HE-Tag: 1696921646-505273 X-HE-Meta: U2FsdGVkX1/FyBzVRh8hYwEI+MgIeGL7V6rmTWe8YKWVWmQOY6EeBNcd6L6v4nD6MvkPwsL3MNOJUPecdbPzASR/BRJjE0AKeia/L05RncAeCGOXzP6Xjwtt3WG64cpr59qHnSjFIazVAlybUN30hBv3uRIQK8rKaXJzTNZzS77Z0w4D6y2roIXau4v9VVDQwQcpA2ke4n/JPGVUMa8MA+dzkPN+si1uxqVoCKfgoBXHDdEmuN7fgjXQ8/cCd6zoeJiuWCgSaaqfpZGBpM/fuFkMZnPNGeo3G95PtXgZxUpEngvOws8UH1bh10gcTR1xSMTePHMcakKr1HhIgsGzGiLt7TreFpgAA4jtwDdOqmbT8blmuajgH0vynIY/13gxE7bVjcMrlaJMfuxx9G4Hs4UrbGp/1Ih9XyqJ7rysYDJqO0PFJdeN1rLJZ+KmW5hKJgiz/yVWff7OPalC+k2/y88smBIJSjYwJsJbldqL5FGfybz/tWJroplUWbMeudsz/xDUdg6G7WnHl/bM/wz1V+4gy/Shv3SgXaTyoAMbVr0qoq2TMGCRp20mhx7rQyMawWl+wFG0+1X5Zixfv4QI96L/Nq4V0brIeqPftYZpRmrRLjX/hPledau+qLTUfrGEFphOaStnIwelsyTEeGDDdKoFEB0eqKaOSqzS8KX4bzPl9HnYMCv867bzPb8H7kKzQdM+dF9SaHdSWp2WP7R2hvkK5MEBwy0RL3JCPTtldW9/2Y2UsUwqFIZKH3vCw9L+JD5p1jzWNGyO1jpVeTKXdUPsKjSMCPOkQMfGqED0tsgeUxQvJ5jQeUfAzR30AuZStdje7S6uFMR/TprwMLN1j7/VNZkN/SsAKCznqgMz9zTFm3pFNhjgKbqvZPpe0AFsLG7pF4YUlDtlFn4ISRTmHLXdbnG5pSCef9/ql1ymTzT6DH7/6vGS3Pbj0RkoTypzu2Y7C4ISPGwJEjwrSEt MHvpCQCR VjGxvRToAgPMPS/UVMik1/FdCsR0b55+W/xqnLsGjs3IjUMR+Efti12mpTbZhYLnvdthk68TGIGGbaZ7IaMYBJAviFO2OC5R0qUFlzN1M3Ty4n2FotdqscfTeJNztAvbSLWX0Nc5qarSVCRJMJPpVj88qiZ0vFuEeOtPAPiFh2hoiUOTyVvDbiQzFHRUHC1zMPHCb 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 36c5b43999e6..32af41160109 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; /* @@ -317,6 +316,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 */ }; @@ -373,6 +375,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) == \