From patchwork Wed Aug 21 19:34:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13772025 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 859C6C52D7C for ; Wed, 21 Aug 2024 19:35:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6C2DB6B019F; Wed, 21 Aug 2024 15:35:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6745F6B01A0; Wed, 21 Aug 2024 15:35:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4ECC56B01A1; Wed, 21 Aug 2024 15:35:12 -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 2B8496B019F for ; Wed, 21 Aug 2024 15:35:12 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id DD663A9119 for ; Wed, 21 Aug 2024 19:35:11 +0000 (UTC) X-FDA: 82477256022.04.8F36ABD Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf21.hostedemail.com (Postfix) with ESMTP id 422BA1C001D for ; Wed, 21 Aug 2024 19:35:10 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=DjAQCtnV; spf=none (imf21.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724268803; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=WTfKAvywvhG7fx5/3Y/15ASwygZFYxxage+aqiSBrsU=; b=kZ4hRJPNEvkAslaP9bRRp7fIi3ghtU0mmq5q4zzYKDMDoVpP5L87uy3Cq/aUJ8JoEw83ud odL8QMvo0ohuyH6D0R3mUQVw+IAPoVGPRfPQKzmqk/3FtqhebxCLO+3Ys8w2DmYvFTC/Hj Ql6pfssfvqKqDt06dnzIKGR4Sdmsye4= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=DjAQCtnV; spf=none (imf21.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724268803; a=rsa-sha256; cv=none; b=2qeQo9lhsjfgCyn9Bdxt6xgUGts3+UNRX9la0J+ukBuLtjrMaImAgMpuVkdgKGNM4UwJjT KULtIS3A8X/2jQK8W6/4NOioj6eTyb9xiZrq6r5HevSJPT2sWw7aicjYWkia9yhrfR9S3U cSuyhZfe0HRrepRueljBo1vRaDiBnYY= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=WTfKAvywvhG7fx5/3Y/15ASwygZFYxxage+aqiSBrsU=; b=DjAQCtnV3jMm8iu067wu+Qr5Cu CjerHrxRxu836V35pS0wiXRDF4UYquh2YNJp3b3fCuu5mWuvXOP5xwgyAXjwCXgi4zazW9XsFqUaq YybU3J67oxBHAr/ISIvG0C4729Wo8A/KDerpkOCJuTl82sMdMXlFiPMPUKvrUn+PMAvHhMEruW3hF 5U+uX86iARzUbClb28wJuZ/nehUlFmwOQfE6JWzEc7Ji2mlb+cIaQmXBaWCyCcGadbpUO4aiI7p0+ +6KgZqGe/GR2u4HZALZetISi1tz6x89FZXjQ9Tt71ekeyResehRCRbW0xi9RXFhUqozRKeB6BeewN Z2OEaoxg==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgr6U-00000009cqb-3Pnq; Wed, 21 Aug 2024 19:34:46 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, x86@kernel.org Subject: [PATCH 01/10] mm: Remove PageActive Date: Wed, 21 Aug 2024 20:34:34 +0100 Message-ID: <20240821193445.2294269-2-willy@infradead.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240821193445.2294269-1-willy@infradead.org> References: <20240821193445.2294269-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 422BA1C001D X-Stat-Signature: tpyt51ugx8k5gjby3jciik9fn5dmqaq4 X-Rspam-User: X-HE-Tag: 1724268910-871822 X-HE-Meta: U2FsdGVkX18SVQFy4DCGER3zROr0Edg+Noy2NGF/8cb7qAnRrL7eGngGYJ9qlzwCRtjgkS/E00oUlwj/rePH7Y8bMaZkvltquk9U5SUNQlhyTemJelfIHuD5FV2AvScmM/fgHD6KQtD4lR64BWmb++uHgPvq+FZ+SkWjzS9enEFesnDAsevp+klzt8TRFeNyQ+3HzBvkjC6/ZNMlgorH7gJFdGs4fEoLmF1NRoz/vwZ0Fm+jc2kKL0OuocASAuyK+RNFNANmVjfzSjhsXcc+hlPNgl0LRM80JY8R+KOytjh5VWBEAJbHfIX0ktlVt7IPqk96PlD7cqrt7kT+DfEdA4Cc/+ibsWYLP6k77z6a2cEfIAhf80ZwuvGabQxZ25ut6cxhw5R9AkK04yZ8VInvu6CqgV0eunySLJozvie54H8fA6pWir47mR4R4YafCAVCU2XXmU/1uSuus5qZlCLwtouAI7RL9rPN1+YZyD09VC4CvIE3e3n7s+05LDQyxKb4O5tviSa+juNUsc4PlyHZDoU5aBRSjg02Enyiftt9QGRrb7A5JIVYUa4DOLvDprllPncHTCHk+4LSuN2bnMrzRWeJya7HcBoJjuBNPLQ6/TUgeaMhKXetLhURgLLB36yOmNTilW4gVrXUlhZj1Y704pERGpbzqOTeMcgZXWn7PEgcrvTTi/HcoeftwHYriBXEA/+2NH9yx+8jPHn2XAmuzdjHMvgwE6nPBQ3zt/DkQsq+IVqxECvMjHb9WbkTwakFGU3LTPwHkg8+Hebeiol2AVtv3E72ztiu9cKgV3WrtCd56p5f6e0VV0FGtk7tbWUXe2pgEAyrMs9DVh6UP8C2oXpRcDQVO5Zjx8VWIowaYvuwIS1+WlGL0F5CrbLXqMishVt0YRZoW13jpNz1Sm3OJkrqMBWbQ3erO8RRFWS6/dUhADnltDrqJaPpyO/cLAk/RjfP4F8tdH6lAAfX5IJ /rUPV2LQ yvFHrh2ZRBhN4MI7YHgEVSFExjoxP3/6xco1OQQZDzm2vAGEiN0oRes+gdt1KoSbhF1YULLd4AOD9LksePI/hwOwuLdkVDP5zBvQKXHvC2pfmjVSJmKiddxJ93NOMf5fYoq9EWs+e1kaX9TQ2HJAPhs10PJst+yIJQ5CmxwWtJkBWwCvuqE7k6x4ugYjL9joX5+rewQX4aMFCNcfQMtyBtbCiog== 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: List-Subscribe: List-Unsubscribe: This flag is now only used on folios, so we can remove all the page accessors. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/page-flags.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 0c738bda5d98..65171b8fd661 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -510,8 +510,9 @@ PAGEFLAG(Dirty, dirty, PF_HEAD) TESTSCFLAG(Dirty, dirty, PF_HEAD) __CLEARPAGEFLAG(Dirty, dirty, PF_HEAD) PAGEFLAG(LRU, lru, PF_HEAD) __CLEARPAGEFLAG(LRU, lru, PF_HEAD) TESTCLEARFLAG(LRU, lru, PF_HEAD) -PAGEFLAG(Active, active, PF_HEAD) __CLEARPAGEFLAG(Active, active, PF_HEAD) - TESTCLEARFLAG(Active, active, PF_HEAD) +FOLIO_FLAG(active, FOLIO_HEAD_PAGE) + __FOLIO_CLEAR_FLAG(active, FOLIO_HEAD_PAGE) + FOLIO_TEST_CLEAR_FLAG(active, FOLIO_HEAD_PAGE) PAGEFLAG(Workingset, workingset, PF_HEAD) TESTCLEARFLAG(Workingset, workingset, PF_HEAD) PAGEFLAG(Checked, checked, PF_NO_COMPOUND) /* Used by some filesystems */ From patchwork Wed Aug 21 19:34:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13772022 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 AD2E7C52D6F for ; Wed, 21 Aug 2024 19:35:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DC98F6B0197; Wed, 21 Aug 2024 15:35:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D520C6B0198; Wed, 21 Aug 2024 15:35:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BF2816B0199; Wed, 21 Aug 2024 15:35:02 -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 A01F76B0197 for ; Wed, 21 Aug 2024 15:35:02 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 4E0D680FDF for ; Wed, 21 Aug 2024 19:35:02 +0000 (UTC) X-FDA: 82477255644.11.9F3388A Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf09.hostedemail.com (Postfix) with ESMTP id 9FDD214000F for ; Wed, 21 Aug 2024 19:35:00 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=i2MhATVc; spf=none (imf09.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724268861; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Z1DuzeAr1D4ZoS8EJ71yYTgQwfxw4lV4F5mPx3QubfY=; b=XnG+/jFbh/T9qfqm4DBqvqnbZYvzX6l1R2wudxE8c8Xfo90uDdqFPNIr56UFR9XeSK1BEr 3BZMJCApkEytYV1IlyyApjlRYZITlmdsFuo3yLXitWzQ8Bi9meEM/jqU7QQ5vov4uDKHOJ QSxgZTn0+axn9hRBUDHeDEUpLG36Fl4= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=i2MhATVc; spf=none (imf09.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724268861; a=rsa-sha256; cv=none; b=c9lFx/1NcKTr7gSWOk2R1naHsP7b/BVxJYqgqPx1+KZWWSE9v+DKiXu0h6tqDRwLT1hz4S G49wWmF2YNSV1yi52OHCyfS7wNLxTxW0kvWp6kKL39BJqRM+ui4aimI4OsBe4ICgMeQ3An eYh6FwzjWG4dGcmm8bLbRELNoITnfGQ= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=Z1DuzeAr1D4ZoS8EJ71yYTgQwfxw4lV4F5mPx3QubfY=; b=i2MhATVc9Iivb+xtCGY94TQ6Zm 7FRxDEnCniqrIenwJbxD8HymbGZeWIEBbT8UW7HfQkG1TCCmdHazSXeIzDRkTHOMN9oq5644o9BPj hSg1J0ZoRSA5ENZuS7GJITb36NyCvjm65bVZJGBIVWHst+kjQdl7mZwGSBkSGr0HLA0oraGuJI6s8 zyuYwfDNvmJppUp+RuejqII6yyVZTdlrk7poknJ2jRb1WGb4War8zfLaXhdEfNsUfPsHmuVrvYsV6 NpMx0s5Qmf6ZbN7zFPxy54ZxJlkF/PNiaDlRlensptJUSgEWvVZjLZOo/+D53bd5esqFL8T8/28G+ BTFlyHqQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgr6U-00000009cqd-3niY; Wed, 21 Aug 2024 19:34:46 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, x86@kernel.org Subject: [PATCH 02/10] mm: Remove PageSwapBacked Date: Wed, 21 Aug 2024 20:34:35 +0100 Message-ID: <20240821193445.2294269-3-willy@infradead.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240821193445.2294269-1-willy@infradead.org> References: <20240821193445.2294269-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 9FDD214000F X-Stat-Signature: 8d553ze1dz8w3s5bfncgfjgzj54ue4k1 X-HE-Tag: 1724268900-768329 X-HE-Meta: U2FsdGVkX19zKK83Zcm2lCO1+EO1/hbTg0BD24B9JF7iCkNRCZkzqSTgowzRoMz6ajHFqce6gf0wAdP2YMRm897kPrlMJHKha2KqzEwPz8PrveHrXoSQAr8CBw2jX1QjvM9dRAFMVKb/LLI9tHamZ55Ha9iYTXU5Dk5VSz8gzuIiR0ITCE/7gj5UnD5KoqlPFqlXNYLs+ilKk4Hvvjw2Z+RKtt0frsbLw706TWC3iZGVT8IsXz+gtNx2DAvqCXtvM4EtzNhGKg16+ozBaNcAEovfWmUnsr4TVXmgcM1EQJl+261uajplNuJVUqLViO0fVKe/07TIVD69aSmzwQE4/vstzIIaaP8noWOUxicH2kKwXLJfa0PSt+C7j7PMcF289/6Wmq55BnupmaFpsHRBzkHUhLXDLxm5+q1caV4Wv4FA/sX/Wyrk5KOec6v5maA5+pRBGa0VGcoab8EQk74hVluvsIaWXtn4PnoLuwrdKILdB5J/ps1dKGFIeJwuhdbLM/QsWV1UeJ9BIrX0n9788oXerZtjxleseUjsc3yS1kr4DBiG3uIRkV8k+WOuKtPKP3yMKQNlmFR2Ayy+DghZTO8X0e4+yRH2QcU00Jq44KCpQGKUK0rxIv4RZoldxTp3Wd/CTsvmh3iZZhON4i37P+Ej7+h827WJMzqD113ck138LEzThqfD6KJv+BeDL9QOiqlUji3Y/h20i9uOfvSIbPs59GVvizB5dGmQ+tWdQhomlAUg6bzJiPIzYwnGhNYlqTEbVC54+orWWlxpqDfvbiWXFGL3dBcThRp/Hm49g/o6bj2wEY0ZGraMZnPmFcIb81Hi9mtyICn1HEdigoxFcq6XCExSc5OntlgHi0nNY7jcsel6fezXP5w2gf8Hj2SB2F5Ga8aGNd4puCbr1ndes0WPzSy0H91urb6EXfK04po2H8M2tXeHXSJs8EZB5zy0q+1cVvbI2T5N8raQBuy SVP/8itc ivL0gVBJ4FbWUusEtIvE4QOzBv1TA3hX5OeIknm3wKglRrXdbhzft/wa4/r92ywc1ZjUEXL2MElywKfnv3jNslOJKN4S7qsoVM0N43fQ54ERgqUdZUM6Iit2oEXr0c2ABEoYD34+6HQc++Xjvm/YesyuWIGKjecNOCuc41sbURUFZJ0m+rwpNPDC9Wiij65ELe7wCcZfRA0XFL+TFJXbXhPF/XA== 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: List-Subscribe: List-Unsubscribe: This flag is now only used on folios, so we can remove all the page accessors. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/page-flags.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 65171b8fd661..5558d35cdcc3 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -528,9 +528,9 @@ PAGEFLAG(XenRemapped, xen_remapped, PF_NO_COMPOUND) PAGEFLAG(Reserved, reserved, PF_NO_COMPOUND) __CLEARPAGEFLAG(Reserved, reserved, PF_NO_COMPOUND) __SETPAGEFLAG(Reserved, reserved, PF_NO_COMPOUND) -PAGEFLAG(SwapBacked, swapbacked, PF_NO_TAIL) - __CLEARPAGEFLAG(SwapBacked, swapbacked, PF_NO_TAIL) - __SETPAGEFLAG(SwapBacked, swapbacked, PF_NO_TAIL) +FOLIO_FLAG(swapbacked, FOLIO_HEAD_PAGE) + __FOLIO_CLEAR_FLAG(swapbacked, FOLIO_HEAD_PAGE) + __FOLIO_SET_FLAG(swapbacked, FOLIO_HEAD_PAGE) /* * Private page markings that may be used by the filesystem that owns the page From patchwork Wed Aug 21 19:34:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13772021 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 8C4AFC52D6F for ; Wed, 21 Aug 2024 19:35:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BA5516B0093; Wed, 21 Aug 2024 15:34:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B2F736B00AC; Wed, 21 Aug 2024 15:34:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F64C6B018E; Wed, 21 Aug 2024 15:34:59 -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 7A13F6B0093 for ; Wed, 21 Aug 2024 15:34:59 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3B67AA9115 for ; Wed, 21 Aug 2024 19:34:59 +0000 (UTC) X-FDA: 82477255518.17.D042FC2 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf17.hostedemail.com (Postfix) with ESMTP id 9B94340003 for ; Wed, 21 Aug 2024 19:34:57 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=qrh9nS3i; dmarc=none; spf=none (imf17.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724268832; a=rsa-sha256; cv=none; b=mf+UvAYz/FK4UcwxxTnAfqQ+wVX2jK7Ko+A2RHQkseqmEWYywfeofikgCjYWiRHRnPniRz uGH+Z4apoy06fNb4Wv61bwHeu5qpQoiWf8SKIFfsrvWbJRqzXZEE3/x8/w5oIGX8Xcm1t3 UfgXlHeOUmBYBRgPRhTmTr8ObAcGq5k= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=qrh9nS3i; dmarc=none; spf=none (imf17.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724268832; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=aiK4+/NIkBbmyUkC/1o2gVxkfVM2L/hjCN9VBJXNw24=; b=jHvTIBdFxbG5PxtzBmMBtDQR+lXH8KCbmFJy8fBiyYpI6vhsaijNjqqBBh4Lv+zmgROcC8 ZPtX5Mmo9z60mfvzMv1IOwItkf3MlwFWMM/BRj/6mrwOEIYW/T3MOH9z1AtzL3ZCHCgOyd iul9kX9fjJbDleXi6gwuaTRXrbNdJgM= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=aiK4+/NIkBbmyUkC/1o2gVxkfVM2L/hjCN9VBJXNw24=; b=qrh9nS3isTExJ/8+GAk0h/kJCs Vqe9DtD2xbzVF70UNONVui+RA5GNNtm+jyg8NTsI0SsFpM7tNBdvuHgtScHAXger2DZALm4bkEttn 4vFKIkog43xURN/KBM/c/mR9tpNYRNDERwqLKAIr9NsFoJM5E8J8X0+6Bc9eifg8/5pnkyyGbe0d9 XcDg3i2NfcvWNPdxJlL6WKvnE2+A98oAjf7IOTyRyu2AkmRUH3wtWMqV0MUjaUseX4ZlDN7e0/aZL oCBvDaPRLHLC65KGD98rSqdhxCglxAe/JFPNgNhjt4N2h+fH5eExDVROgq8Yecj53Ffv1MVZBrlWU uJjdGYRQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgr6U-00000009cqf-4B2v; Wed, 21 Aug 2024 19:34:47 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, x86@kernel.org Subject: [PATCH 03/10] mm: Remove PageReadahead Date: Wed, 21 Aug 2024 20:34:36 +0100 Message-ID: <20240821193445.2294269-4-willy@infradead.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240821193445.2294269-1-willy@infradead.org> References: <20240821193445.2294269-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 9B94340003 X-Stat-Signature: swqy9udseeece96b3a34ck8w6i4we8hz X-Rspam-User: X-HE-Tag: 1724268897-356481 X-HE-Meta: U2FsdGVkX1+N53FxRmMSGgm/7I7UuO4Z5FGJknm+KbGq62OicsM/ti8ElSRfkzSeHtRpFD2c1ZOLY20UeIt8jjTZ0Xn8LKj3/ith/cP6/Eqkxw20eOUrJbmuSijfVzt8QEb98e4bg0giV3r9Qm6PqrHsBi+IziRKeNJj1QUroifhv+X/FcjWTsVWK8O1vJAoujgMD6YRTgI71OgBiHwfvnegID4TmQOfwSraJK+8n0cWu4kvOZgy6PGp0uSKRuXXnibPvJ3K8TM6zh6XY/qmgWiFJnZdtzB2SSV9RfSco7kmdNNy2eVmDLcf1+jw2uDObX1a7rCzOvJp1wwqU9TorPxvBLbfwSDNa7qaNUUrgsux1YeHXdThPm1O71LI8MePqrFzAhVmGnQSttPnaT8/hdORl463YqwwLHLjctDtoULQoLkzW3AbreQULUZpWicEFyOQ7JFLDRL4GtPBSems4GK4rfKb76fvABP6xzPEfpUO565ts8nCcpxDYHyFhm/f+9Ol98vMd5vGrBw53tZ5cSI/7UrPyDAngyK8l0nDIQ7jNoKHcBuIIuryvkpW4fI0573Xtswb8ZTU8vEAdwOCfOZ60iAMV9lpOZOMAu8Zft6ho/GUzxdoNsQaI3E5kX2ezj9JXcK8/xfRpJe3mBTf0Y66eUOr1siiSL9WZ9eJNK1MFJsABfQYbKRAwDiOwqqQHFaX0Bwb103OXwacL1OWIBBwZQjGxWmhhAsFr+obOfSzq8ngZax72WHEr9psYRshJg0zYWdWE4oZhXzcwqVd+z1RR2en2tX3tOGvXTnVE+GSE+BZr3mBIT0qQkYP6hLqtfDievTJv5BKEu+Rm0h+67lpIQ/EqSWSzf0pV7seLgJig3i7cmGZlig+N7RUPPZbh2PF4wlSckxXHAGR4F/LsbHb8A84W40vsqTiQ1B1PnCDOuRVUrCOI/j9fvRXcCYOksZdQvteOMY3rUtH9fq Sf3tRf3p UhzcxgDnpX2ASMEzXtJ6tanGBSZq+JblsGI1VkFzedh/wEspukPBfV+6+KGZ94YY0SEf1Hci8ibN2hH7RYhWnWhZEiSmWRZzOR02H3Ca/92jBgsUrVVgdtN17RsEqI7kJ+W6ErcIxO6CrIEpfhC9vnW7hpZS9ZmxMPc82/H6jXZ9Ovgymzk67smMHaUVTojbSbsaIEoYN0u6gjd/EZjZNpEfl3g== 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: List-Subscribe: List-Unsubscribe: This flag is now only used on folios, so we can remove all the page accessors. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/page-flags.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 5558d35cdcc3..2c2e6106682c 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -553,8 +553,8 @@ PAGEFLAG(MappedToDisk, mappedtodisk, PF_NO_TAIL) /* PG_readahead is only used for reads; PG_reclaim is only for writes */ PAGEFLAG(Reclaim, reclaim, PF_NO_TAIL) TESTCLEARFLAG(Reclaim, reclaim, PF_NO_TAIL) -PAGEFLAG(Readahead, readahead, PF_NO_COMPOUND) - TESTCLEARFLAG(Readahead, readahead, PF_NO_COMPOUND) +FOLIO_FLAG(readahead, FOLIO_HEAD_PAGE) + FOLIO_TEST_CLEAR_FLAG(readahead, FOLIO_HEAD_PAGE) #ifdef CONFIG_HIGHMEM /* From patchwork Wed Aug 21 19:34:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13772015 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 A15C2C531DC for ; Wed, 21 Aug 2024 19:34:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1BBBC6B011A; Wed, 21 Aug 2024 15:34:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 178CF94000B; Wed, 21 Aug 2024 15:34:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 03C806B0193; Wed, 21 Aug 2024 15:34:51 -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 D0A986B018F for ; Wed, 21 Aug 2024 15:34:51 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 718851A10DD for ; Wed, 21 Aug 2024 19:34:51 +0000 (UTC) X-FDA: 82477255182.29.AEE267F Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf24.hostedemail.com (Postfix) with ESMTP id 4A3D2180011 for ; Wed, 21 Aug 2024 19:34:49 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=pZIcobPr; spf=none (imf24.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724268810; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jKZijI013UrsY8//D8mSr9BHaGPMIkaEKCgxfvI4RII=; b=oWp1IVaymBoXhnCoxc4aZIiJRKL1l6g57flClNahmoeAjjPEkMNaxReIg+HPrJAT0Zo0R3 rSx5jAx6pmQ0mdERyee7Y2mEcsqbvA71EDxyZQINDNRmt5EU4ZzCzOIzpDkbOIM3ePDm/a bGHaex1bvFWCIwthQ+3mjmsDJz0rn0A= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724268811; a=rsa-sha256; cv=none; b=12gEJfDAC8DcPw9OUusfwrQTWrTo19vJbPLJp7BtEkiTPqd9Z1kJC88l07ebQObKPmdUJh AVBo5a8+hvgRFaYU5slW/ycF51F3UTF5H4/K33FyfNW9aJzuMCt7ZoW+TkeHVtb2R7fthe Xl6BGJ9+e8lzZUi/eLxKsG1lMpjvjO0= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=pZIcobPr; spf=none (imf24.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=jKZijI013UrsY8//D8mSr9BHaGPMIkaEKCgxfvI4RII=; b=pZIcobPrDSGyDZSfT22Thcx82Y Bz8gpO59ik5Vo66lFek33lsTTg5neo+jY+1k3MpSbwRC7DBsBOoVpt6Llh+CaDmRcwl+znpv8IykP /PQhyZ55sfZ8VEbcPGccP3lnQAxzlaDwWGRmvAYvSYsBlQz6e7fHwSDfH2r1rHPnuL9mKfS397KCn iH4nGnTjp/IQtbuIuzRzHc1c9pgmrTfJCbELyFUmgE85hLGwnAqKWlOr7f1uWKYCujHd24z7VChzT KT2/dtxA1vy4WR1rSaCp+psxA7LuoEg2kI3oxTrvRSRcW0v5UakYGsMl1DfNgKs4csHeZoHn48rmo 3DDx2+Xg==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgr6V-00000009cqh-0Njj; Wed, 21 Aug 2024 19:34:47 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, x86@kernel.org Subject: [PATCH 04/10] mm: Remove PageSwapCache Date: Wed, 21 Aug 2024 20:34:37 +0100 Message-ID: <20240821193445.2294269-5-willy@infradead.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240821193445.2294269-1-willy@infradead.org> References: <20240821193445.2294269-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4A3D2180011 X-Stat-Signature: rx6bucd735gakxq4g4obxrhgc6jud1i8 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1724268889-263276 X-HE-Meta: U2FsdGVkX18Gt5KrpdFxT8IuAXhu+aQSNe6YAV6OyahHws5KsyU1N3x8MARzzS40UVsCflTeN5RDHbf3trA2BnqXqgabxB+300iTLcR3+CDTCLNCE3XNwtxqrLIgN8zwQ3SLLOXbymwiSbVQJpJKPpeW+jf+SN15a/I0OhNKPAGaIv7mkD2fiwh5QLH5fV1qUBY4VC3jkIc13Dq5QWrarXEvYAjM8W+PUjIWNLUFJgaC2TjaIsI7Vhtn7X9jV+CbuSWcxAz0+rshR3sRjP+f5xzJP674A6bRcnnsj0FO0oEgzZB8aN85PrLhGoEPAFSWlu9FX1eTyRLQCWAfC7ofFc4+Tz4ml7FQ2WyjpQknfkAkS/RaFeiNinmh+dA8Bmpxs10LDwlk++PT7Piv02KPH/6aHLLYW9h29xKCsHeQYwC4wQ22EKtBPf8Ge4ZEAR0+7h7s/x58MWcQKazm4535xPdNr4uMIXyzyCN3bxUMo88tK0Pw7u1k7Uht1E90Nj8tFE8KBOFhGzh/we/ZWWaudCTKo2z0ioh/tsItU4YTFYfmvYNl1G6tXtO3RPL/dAsdPCpGCU7Q/9U3iZPMo6CZVTIo3USjVXm4dKfkdaMr1cfY/Zncu6A8gZCrQgKJAIMJ2mPlOnlD+kapmNOsnWaEVMy5SyUvyZxo7UpFfRbZ8OQctOM1qSbFjwhcgMqOMjj/TSnSFLYFwjiriyM3qqfYS4+r8DTq8/ktZlXwd44UFYO8W+WWlWWz79kcSuCdNDEVv0Xk0QOyhl37sRmdtrtMeBigu8DzJ/80qbQkNp2n4v6hL6FV6c4rdwqSBPpZK3+HP8z3Ythbu0WSSwJRXXXVk0bxO1lzreimCXAxvSWWsFRoExUv22A3x9OMyos4eTEeN42sHOkMHoBdZTSkG5C65QlOyltbUVJ39NzDE1Tg+dXa7hxBRcnqgV06GxevRR+BppmE6toR0kwQdzK3Ugm 8z+0nvg8 mAfuBMK35ku5l5qDl+f7VOBbP2DEZozw+KI9GYR4oIZyuMlBqaYF+UpBlWTqu5Ix6CvkKvWkidsW9gWa8/qexeT3YCVbQPXX8Vhd1LoiPhNX1HamdFt8040mFuJUY3VH2Xu5aYQyB414irYSi8mUGwQ8gPLA46m28hXkB5WXO7g9wqDhECW6n5SkY3G9HKwNld4V+oVDgWxVjJqwiUfr7bkSwbw== 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: List-Subscribe: List-Unsubscribe: This flag is now only used on folios, so we can remove all the page accessors and reword the comments that refer to them. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/mm_types.h | 2 +- include/linux/page-flags.h | 11 +++-------- mm/ksm.c | 19 ++++++++++--------- mm/migrate.c | 3 ++- mm/shmem.c | 11 ++++++----- 5 files changed, 22 insertions(+), 24 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 2419e60c9a7f..6e3bdf8e38bc 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -109,7 +109,7 @@ struct page { /** * @private: Mapping-private opaque data. * Usually used for buffer_heads if PagePrivate. - * Used for swp_entry_t if PageSwapCache. + * Used for swp_entry_t if swapcache flag set. * Indicates order in the buddy system if PageBuddy. */ unsigned long private; diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 2c2e6106682c..43a7996c53d4 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -574,15 +574,10 @@ static __always_inline bool folio_test_swapcache(const struct folio *folio) test_bit(PG_swapcache, const_folio_flags(folio, 0)); } -static __always_inline bool PageSwapCache(const struct page *page) -{ - return folio_test_swapcache(page_folio(page)); -} - -SETPAGEFLAG(SwapCache, swapcache, PF_NO_TAIL) -CLEARPAGEFLAG(SwapCache, swapcache, PF_NO_TAIL) +FOLIO_SET_FLAG(swapcache, FOLIO_HEAD_PAGE) +FOLIO_CLEAR_FLAG(swapcache, FOLIO_HEAD_PAGE) #else -PAGEFLAG_FALSE(SwapCache, swapcache) +FOLIO_FLAG_FALSE(swapcache) #endif PAGEFLAG(Unevictable, unevictable, PF_HEAD) diff --git a/mm/ksm.c b/mm/ksm.c index 8e53666bc7b0..a2e2a521df0a 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -909,12 +909,13 @@ static struct folio *ksm_get_folio(struct ksm_stable_node *stable_node, */ while (!folio_try_get(folio)) { /* - * Another check for page->mapping != expected_mapping would - * work here too. We have chosen the !PageSwapCache test to - * optimize the common case, when the page is or is about to - * be freed: PageSwapCache is cleared (under spin_lock_irq) - * in the ref_freeze section of __remove_mapping(); but Anon - * folio->mapping reset to NULL later, in free_pages_prepare(). + * Another check for folio->mapping != expected_mapping + * would work here too. We have chosen to test the + * swapcache flag to optimize the common case, when the + * folio is or is about to be freed: the swapcache flag + * is cleared (under spin_lock_irq) in the ref_freeze + * section of __remove_mapping(); but anon folio->mapping + * is reset to NULL later, in free_pages_prepare(). */ if (!folio_test_swapcache(folio)) goto stale; @@ -945,7 +946,7 @@ static struct folio *ksm_get_folio(struct ksm_stable_node *stable_node, stale: /* - * We come here from above when page->mapping or !PageSwapCache + * We come here from above when folio->mapping or the swapcache flag * suggests that the node is stale; but it might be under migration. * We need smp_rmb(), matching the smp_wmb() in folio_migrate_ksm(), * before checking whether node->kpfn has been changed. @@ -1452,7 +1453,7 @@ static int try_to_merge_one_page(struct vm_area_struct *vma, goto out; /* - * We need the page lock to read a stable PageSwapCache in + * We need the folio lock to read a stable swapcache flag in * write_protect_page(). We use trylock_page() instead of * lock_page() because we don't want to wait here - we * prefer to continue scanning and merging different pages, @@ -3123,7 +3124,7 @@ void folio_migrate_ksm(struct folio *newfolio, struct folio *folio) * newfolio->mapping was set in advance; now we need smp_wmb() * to make sure that the new stable_node->kpfn is visible * to ksm_get_folio() before it can see that folio->mapping - * has gone stale (or that folio_test_swapcache has been cleared). + * has gone stale (or that the swapcache flag has been cleared). */ smp_wmb(); folio_set_stable_node(folio, NULL); diff --git a/mm/migrate.c b/mm/migrate.c index 1248c89d4dbd..4f55f4930fe8 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -666,7 +666,8 @@ void folio_migrate_flags(struct folio *newfolio, struct folio *folio) folio_migrate_ksm(newfolio, folio); /* * Please do not reorder this without considering how mm/ksm.c's - * ksm_get_folio() depends upon ksm_migrate_page() and PageSwapCache(). + * ksm_get_folio() depends upon ksm_migrate_page() and the + * swapcache flag. */ if (folio_test_swapcache(folio)) folio_clear_swapcache(folio); diff --git a/mm/shmem.c b/mm/shmem.c index 22a3f3c1897e..752106aca845 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -502,8 +502,8 @@ static int shmem_replace_entry(struct address_space *mapping, * Sometimes, before we decide whether to proceed or to fail, we must check * that an entry was not already brought back from swap by a racing thread. * - * Checking page is not enough: by the time a SwapCache page is locked, it - * might be reused, and again be SwapCache, using the same swap as before. + * Checking folio is not enough: by the time a swapcache folio is locked, it + * might be reused, and again be swapcache, using the same swap as before. */ static bool shmem_confirm_swap(struct address_space *mapping, pgoff_t index, swp_entry_t swap) @@ -1940,9 +1940,10 @@ static int shmem_replace_folio(struct folio **foliop, gfp_t gfp, if (unlikely(error)) { /* - * Is this possible? I think not, now that our callers check - * both PageSwapCache and page_private after getting page lock; - * but be defensive. Reverse old to newpage for clear and free. + * Is this possible? I think not, now that our callers + * check both the swapcache flag and folio->private + * after getting the folio lock; but be defensive. + * Reverse old to newpage for clear and free. */ old = new; } else { From patchwork Wed Aug 21 19:34:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13772024 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 9C0D0C52D6F for ; Wed, 21 Aug 2024 19:35:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C436A6B019B; Wed, 21 Aug 2024 15:35:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BF22B6B019C; Wed, 21 Aug 2024 15:35:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A93526B019D; Wed, 21 Aug 2024 15: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 871436B019B for ; Wed, 21 Aug 2024 15:35:08 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 43FA11601E6 for ; Wed, 21 Aug 2024 19:35:08 +0000 (UTC) X-FDA: 82477255896.24.9977304 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf22.hostedemail.com (Postfix) with ESMTP id 9F6D6C0016 for ; Wed, 21 Aug 2024 19:35:06 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=bz4y1KMz; dmarc=none; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724268817; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=PFYGF888esVx5is+dDOIN1XZFjPX09/KPzfotQSNrpE=; b=HajmzoGVM2eVlHAoysdEunvFdyU7b/f+xkXWbiNtGES4W/IvU6359jJ4GLZoEkzKv628EO axG5HiSMOcEQWz/mDKwm/wg7Aeemvi9lZ6jzSOnDjw3fNHy/8UV3g2UzvcPst6TFXspUy0 mZvAwQWsiMFGa7zJH18WnIBjMW2W1r0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724268817; a=rsa-sha256; cv=none; b=mTooGQktVZ8GuVO7HeYMVucURqtNZ8/ZAu6CnAEacQtjpErm1d859+GtH43pCQfKQf7kq0 4s5dWoyYmYJo3/PyRLkFf55+giWAxGJMkosUAebD6BJph1zUj+YPjPi98X4AiFE+O5Q6pD /XwZsQcasDqE+wQ9SNkw2OqoiweK13Q= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=bz4y1KMz; dmarc=none; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=PFYGF888esVx5is+dDOIN1XZFjPX09/KPzfotQSNrpE=; b=bz4y1KMzS8T/uu3zwWjk/iTFzg Dz9zVtDX+aD2O81VUnyS8Ci9+9iROW7x9hQql9Wl5x+3DUJBCFOA8Rc6THDTlZPyNUw1JNh8r97EL 9Uyvq+us/PqHxShueB0wN+4yqlLVJYl2pJBKi1F822Gmz1+NW14DGHuqCdc3gzGW33NKNnDnyKkzb mkjaG4Xmsa2cZq+dwzT7ZSmEdJB0PqXbB/tHlpwQnaFPRAORo7YVew2AdiCEBpTOsF4oPdJogOMHH 35SWcnbOzIBtUZjARl0d8MNDoJRMzBo0Kiluc4G6jTBIz79/mPp0tqyo0s+9yvEonoR4dgaQC9Jrq IVLRVLAg==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgr6V-00000009cqj-0l7L; Wed, 21 Aug 2024 19:34:47 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, x86@kernel.org Subject: [PATCH 05/10] mm: Remove PageUnevictable Date: Wed, 21 Aug 2024 20:34:38 +0100 Message-ID: <20240821193445.2294269-6-willy@infradead.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240821193445.2294269-1-willy@infradead.org> References: <20240821193445.2294269-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 9F6D6C0016 X-Stat-Signature: kmtk76a4x94zk1gr4yzpc6zza8aoipym X-Rspam-User: X-HE-Tag: 1724268906-84966 X-HE-Meta: U2FsdGVkX1//PtbVt0HKnDWJcuQTaTJvU2VxgVx3yBj73lcSayRQYMbYKbtpkQvNi4eqkxYO8T8Ahu9aLDLN3c9RiDDXi94VfsQ5SsARQ1seabbdE0aA/gHJIPbEIObHz8jlXt0//BUWoOdmOdNK2kpcxlG1sl8Lu3AncEP+/iOUcmPsTesTk+eXuqRccm+ZZHYsV7tS6rNVaeJe6qjxB5HtIaL8rckuxwqcFza2FiC7+ImraNwHUEBxRwRBfFoVh/TOy6bnzLFzEAteE5jTobcfFaBaehWGNPbxrWO+KQJh7jmNWdKyg5vDPTYTk0XqRT0Oljsk1zdtNrhz9HDihgUP9uY5YAM2KOICYyTRrC7TjMnxKMklvCYnN57401dArpKMvs++RPJ52JtvGpQ0keiRTXZs+5CyeXuiG5L+lr/wMhB7AeHXeSG3jR65apP3zn3/HctxCkO5jqgTLbXtpGyN8na1AsJll1InnMnjmnmZZV7HGnsxajIk7j1+zmbRtNETWYqmruf75+4aZokZogWToZ3jwNpc8kuhFDrH74ohCqO2xnPMbDyownucg4+sbT4VMk1A9efucFcL9M3KFFRSNR1ZntXiurTa3T7kqPF1I8QmBAlxyGJx4lBbBaQ0/kSHxVRj1bRBp+MD9pmk34k9mhhMiuWcZBUaaqofqMR87x39/P88ag1XfpamCS6D90hToFB5z1cXpC7dFpyd2G0NZVCIpBqEkCrc8LTyDsS5/hKKWX0w83YEL8cm2wuPGhFrBBpUrAIRMlCeQCAE52LRevw9W/QOnFn4vMoh+0iotsdEqB7dr7uXH96kq1cYSMpWam4+Jfx2K5l5N/DIlLvDxE8Du7b5iEmJtd5yEhVuQHm0FlkljaZxYUs6CCQ1KOAVUaiYP+4loXxiCGlc9tC1yk6zHLMs6pbkJEhYx4s9M7eaUWzbVDLkIln3Skb29NpB8pA1NfGZYafpbrF ZsNslPk4 r8cGlIv6uvpKFhmfZm6N9krBatMcbVlOFqQ5AHFs6EQtOvxEQfPqRNmYesLJCKS1xq6otX66u9tQX3/4lo6CGz0UpVGMhjeAjCkjm31cjKw2jHD9eere2ENFd1qMD2vTyamNoB+4cYFOwzvpzRecrGIWAn4YhL00f8X3NZBgXBCSbj9iAOW23EFPanIrqYwFYO+H/q49HCGCT/XD26MH3BIe7XQ== 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: List-Subscribe: List-Unsubscribe: There is only one caller of PageUnevictable() left; convert it to call folio_test_unevictable() and remove all the page accessors. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/page-flags.h | 6 +++--- mm/huge_memory.c | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 43a7996c53d4..bdf24f65d998 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -580,9 +580,9 @@ FOLIO_CLEAR_FLAG(swapcache, FOLIO_HEAD_PAGE) FOLIO_FLAG_FALSE(swapcache) #endif -PAGEFLAG(Unevictable, unevictable, PF_HEAD) - __CLEARPAGEFLAG(Unevictable, unevictable, PF_HEAD) - TESTCLEARFLAG(Unevictable, unevictable, PF_HEAD) +FOLIO_FLAG(unevictable, FOLIO_HEAD_PAGE) + __FOLIO_CLEAR_FLAG(unevictable, FOLIO_HEAD_PAGE) + FOLIO_TEST_CLEAR_FLAG(unevictable, FOLIO_HEAD_PAGE) #ifdef CONFIG_MMU PAGEFLAG(Mlocked, mlocked, PF_NO_TAIL) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index cf8e34f62976..d92f19812c89 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -3017,25 +3017,25 @@ static void remap_page(struct folio *folio, unsigned long nr) } } -static void lru_add_page_tail(struct page *head, struct page *tail, +static void lru_add_page_tail(struct folio *folio, struct page *tail, struct lruvec *lruvec, struct list_head *list) { - VM_BUG_ON_PAGE(!PageHead(head), head); - VM_BUG_ON_PAGE(PageLRU(tail), head); + VM_BUG_ON_FOLIO(!folio_test_large(folio), folio); + VM_BUG_ON_FOLIO(PageLRU(tail), folio); lockdep_assert_held(&lruvec->lru_lock); if (list) { /* page reclaim is reclaiming a huge page */ - VM_WARN_ON(PageLRU(head)); + VM_WARN_ON(folio_test_lru(folio)); get_page(tail); list_add_tail(&tail->lru, list); } else { /* head is still on lru (and we have it frozen) */ - VM_WARN_ON(!PageLRU(head)); - if (PageUnevictable(tail)) + VM_WARN_ON(!folio_test_lru(folio)); + if (folio_test_unevictable(folio)) tail->mlock_count = 0; else - list_add_tail(&tail->lru, &head->lru); + list_add_tail(&tail->lru, &folio->lru); SetPageLRU(tail); } } @@ -3134,7 +3134,7 @@ static void __split_huge_page_tail(struct folio *folio, int tail, * pages to show after the currently processed elements - e.g. * migrate_pages */ - lru_add_page_tail(head, page_tail, lruvec, list); + lru_add_page_tail(folio, page_tail, lruvec, list); } static void __split_huge_page(struct page *page, struct list_head *list, From patchwork Wed Aug 21 19:34:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13772020 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 6C335C52D6F for ; Wed, 21 Aug 2024 19:35:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EB2FE6B0193; Wed, 21 Aug 2024 15:34:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E647E6B0194; Wed, 21 Aug 2024 15:34:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D029E6B0196; Wed, 21 Aug 2024 15:34:56 -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 AF7EB6B0193 for ; Wed, 21 Aug 2024 15:34:56 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 6A867140FE6 for ; Wed, 21 Aug 2024 19:34:56 +0000 (UTC) X-FDA: 82477255392.28.A08FE62 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf29.hostedemail.com (Postfix) with ESMTP id D0BE7120004 for ; Wed, 21 Aug 2024 19:34:54 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=WylXN9Ka; spf=none (imf29.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724268815; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=uK8Vt42wFQRzdcmG5GR/Wkh51WwyJybLOsQGLqtZDk0=; b=b+NBL8iUnLnfw7ruzhnSCZ+TIawQtotWpfUmAz4fBkOPkbzrmwnwTYqZjusH/KF0sU2iyn hpYNzuWBGwwqIW5UDCN2VzsRuWSXJINTYFJPTpU7HS1aGJ1giObWslvHgIGEJDMVpQwATR +LrCvaXjAbzI+jSf4ClXsH6ftUA3cHE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724268815; a=rsa-sha256; cv=none; b=eH4mmu6AqGQT7I3ULRFS2BsU+e2X0EWHvI5pSTmDoZzN/ZiUjq4Ahy8PF+fgI5kQryHTRt maLhMnzQ3UWjc2yEyoFl86ft8pLpILvUt9BN1BLamBkOT7iFgqfXpP5qeI3CF4tWAKH1qa wmtNpMisimLiHAhkC57a6AefnpD/hdc= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=WylXN9Ka; spf=none (imf29.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=uK8Vt42wFQRzdcmG5GR/Wkh51WwyJybLOsQGLqtZDk0=; b=WylXN9KaKLZCC27qUPd+VKLvzI EEywSDbKYBo1MyvJbciFl8KGyL2yLzGdrPEZ3uKpBHk01qt8OMll5J4+luB2P0CKHS3XazzH19/vk VnF7KdvducHWtJYgDK7RFspQ7razapMZQ/3Nu4AaedbJBRGxiyvqJMr1zjS6PvHId9b+EmD2Z9gb3 VSNUG2wL456sm7IGFeOhAHbB/N/1U3EXity8fcoUbar3SLRB8ZsxMGdy1A8Z4e2BYMLhGU/+Y2YU1 6cdKUXUNwO7yMDl9Pordxy+JPhxLXfBqshlhHmdZaeCFV4ZXUnWRtTcmL0eQdYj9B/L63KQWtJ0Qj 3C8+5NOw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgr6V-00000009cql-19FT; Wed, 21 Aug 2024 19:34:47 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, x86@kernel.org Subject: [PATCH 06/10] mm: Remove PageMlocked Date: Wed, 21 Aug 2024 20:34:39 +0100 Message-ID: <20240821193445.2294269-7-willy@infradead.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240821193445.2294269-1-willy@infradead.org> References: <20240821193445.2294269-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: D0BE7120004 X-Stat-Signature: a79mfndoaheynmsbuiummxmj8igo1f3y X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1724268894-505115 X-HE-Meta: U2FsdGVkX1/+lY18UQhk3cc14aCL7YMAXdktctPZ7nfGeCUUR7v79Vsb6bRfKvkA9l1UiwyXhuKpKejtag9EOWnAgxs0qnzG6COnTXY+E2zSLqvlUI/dglCm3UkBaiOZ1pddZ9uaM0zksGczHg/b+deJvAK7g6HydowU6co2WaFazILrrU2R3zFmXVn1EOIpQaX6EdTbpdJ7ReL0xsCN9qe8uqa+0csFJoBTsS1qn69cJYgm/O60j9MZP/Shnhrgpn+oozAawaHBKKaTR57UXOybUH4o9tiVwSMCNeGZUGeDF520L5HwURwLKy0mEKEMlhOCdKbwOvxBPKR+xpp0+zvIIUA2HfTZHLdeB3XB35guSQz3bI1wEi1VkiCHgwcdVaWWGXFbyKtsSyotqosxO39UXAtBBxMmrBHdz7neCl1FFoW4HxkZVKSW//QpeM8X+6wgcm1HXh9CJchTl4TVLdIynXWy1HGzXlLdznty5xEg1j2bBHRfcN6sBoSdUP3zZXi4oDDqZflIUd39j2pgk8SADLDBYbJw22NERE5Dr/dQqJNeJ6HA2mW04BJz/+tvQJ4XTEb/gjhSSUnGoDvY0lw4/75FcWFG8Ry9pyX3mlFa00Y3GZHM7b0xC1nArWK+0A3iMyD1vk/zG+nopJhIE/YZRol2LuU5NpKblgUfj8G0jJo/Ofsl2vZ7k1ZblG67PBquowMjmPmqbCudPTiXZ2XcaAy5zXXNfRzKcfqzici3N6nWjvHFRDQwqgGxcg+v5iqRQ1tM0S/9RPevXezHSF13ZR0sWS8BZHfMYeMq+No+Ec8b5NpQhjTHd0zE4b5KTVrs6dTpWJipKOfPZQFOLV7Kna+yeV65H/uW0ob+xz7oIAXbMxH1ahjY7mjDaRyvxNvwLBEXaBJFb7sRS1HKWsSzlxMYi+Xws0m6+eenNSUFJb8hsYOCRzd3LF7LRk7NKtJrnJnV5JJAYz+Neda HExoxDWQ uKbAN7oIE10UhVp8ixAm9KLpvgdJFo21ACBc6+ZuT4JPB+z8rtIW9mZ3GWA45hEtAqPPhzeFqKw/KlhGP9pFl48Eo1waaihDrzBOH/YdNNet228LQZKwOdLf/Srhm8JPZpepg8hCIxZ9CFEkc7kIxQtJEXYg7VxYu78a5g5XWsuOecyizqmUKI2byRWu2LipbAVyCR2YvY/y1UV7gr94k1tOcxQ== 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: List-Subscribe: List-Unsubscribe: This flag is now only used on folios, so we can remove all the page accessors. Signed-off-by: Matthew Wilcox (Oracle) --- Documentation/mm/unevictable-lru.rst | 4 ++-- include/linux/page-flags.h | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Documentation/mm/unevictable-lru.rst b/Documentation/mm/unevictable-lru.rst index 2feb2ed51ae2..255ef12a432b 100644 --- a/Documentation/mm/unevictable-lru.rst +++ b/Documentation/mm/unevictable-lru.rst @@ -253,8 +253,8 @@ Basic Management mlocked pages - pages mapped into a VM_LOCKED VMA - are a class of unevictable pages. When such a page has been "noticed" by the memory management subsystem, -the page is marked with the PG_mlocked flag. This can be manipulated using the -PageMlocked() functions. +the folio is marked with the PG_mlocked flag. This can be manipulated using +folio_set_mlocked() and folio_clear_mlocked() functions. A PG_mlocked page will be placed on the unevictable list when it is added to the LRU. Such pages can be "noticed" by memory management in several places: diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index bdf24f65d998..f1358f86a673 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -585,12 +585,15 @@ FOLIO_FLAG(unevictable, FOLIO_HEAD_PAGE) FOLIO_TEST_CLEAR_FLAG(unevictable, FOLIO_HEAD_PAGE) #ifdef CONFIG_MMU -PAGEFLAG(Mlocked, mlocked, PF_NO_TAIL) - __CLEARPAGEFLAG(Mlocked, mlocked, PF_NO_TAIL) - TESTSCFLAG(Mlocked, mlocked, PF_NO_TAIL) +FOLIO_FLAG(mlocked, FOLIO_HEAD_PAGE) + __FOLIO_CLEAR_FLAG(mlocked, FOLIO_HEAD_PAGE) + FOLIO_TEST_CLEAR_FLAG(mlocked, FOLIO_HEAD_PAGE) + FOLIO_TEST_SET_FLAG(mlocked, FOLIO_HEAD_PAGE) #else -PAGEFLAG_FALSE(Mlocked, mlocked) __CLEARPAGEFLAG_NOOP(Mlocked, mlocked) - TESTSCFLAG_FALSE(Mlocked, mlocked) +FOLIO_FLAG_FALSE(mlocked) + __FOLIO_CLEAR_FLAG_NOOP(mlocked) + FOLIO_TEST_CLEAR_FLAG_FALSE(mlocked) + FOLIO_TEST_SET_FLAG_FALSE(mlocked) #endif #ifdef CONFIG_ARCH_USES_PG_UNCACHED From patchwork Wed Aug 21 19:34:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13772019 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 894F3C52D6F for ; Wed, 21 Aug 2024 19:35:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D539394000E; Wed, 21 Aug 2024 15:34:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D019F94000B; Wed, 21 Aug 2024 15:34:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B54FC6B0196; Wed, 21 Aug 2024 15:34:53 -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 8E2216B0194 for ; Wed, 21 Aug 2024 15:34:53 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 433E9140827 for ; Wed, 21 Aug 2024 19:34:53 +0000 (UTC) X-FDA: 82477255266.27.6DDCB13 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf22.hostedemail.com (Postfix) with ESMTP id A07A9C001B for ; Wed, 21 Aug 2024 19:34:51 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=ac7hRec5; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724268785; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=53G7OQRwRv/Iqta75K6HOo9hAeq2ZQbXgYcT30n+x1I=; b=OlIpGHnYgI+IW+LiD47Al0XT/+KJIv2eSJmv6h9ajbZoH/rgWcFJgmjgLoVigg5VbtRRm7 yKpHrBDFYTExslaplV94U8NdErt4CDcoMJnRJJ2ONP+1Gay5NwCyhM4bhOaF/2ThVSNfgW ZZjvWGSp3Yie8cZ59kenkJUfp2IjE6g= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=ac7hRec5; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724268785; a=rsa-sha256; cv=none; b=q8ClJpCj+mjhibJDF3kNBGNq2V1BxaLod55ry7gkI74HtHcQkD2aU7Ei8rm2oPaU9AOD0E 2hxtJumN/pxmSK94ZyNhtnL0qTnEm59UT+kp2yPxm1xzO6siDuy4Ye632uYBQoyel875gw 7Q7TCuLvGA+UOuxyfCGfcV8pRZBSWOQ= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=53G7OQRwRv/Iqta75K6HOo9hAeq2ZQbXgYcT30n+x1I=; b=ac7hRec5l1qkplqKAShlhlL3eQ Cjdh/PvoshoWa7liYUNyRh3yG2ZO/0zkkQuCF44wBDMsc7ywxUQvm3oefETB0EkATv0KOj+vwpA2F 2FsO6Ll3fAy6V2wZCSgWKggEUtd96EkKur+9ISSFgjlzifLniEIyjx7mAxvKGsStQzW5vXQdUCkoF xAF5xG0Hyn4jjU4B+HWx9MKPuGiKV8JDGPMqtRUz/CgvZMHikKm/q3S2a/o+29xRSpflvKZxWvAtM vf6GccwSogOh3RtqSKEjuWOkkIM4Oe51iRNcLpd49Z/Fv/u5hUdwRvLJR8dVr/VWpALKz07rV6NtQ X2q7K+/A==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgr6V-00000009cqn-1Y31; Wed, 21 Aug 2024 19:34:47 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, x86@kernel.org Subject: [PATCH 07/10] mm: Remove PageOwnerPriv1 Date: Wed, 21 Aug 2024 20:34:40 +0100 Message-ID: <20240821193445.2294269-8-willy@infradead.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240821193445.2294269-1-willy@infradead.org> References: <20240821193445.2294269-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: A07A9C001B X-Stat-Signature: d1uhxy6o4oourcmad3ncr9wr7ehhu45k X-Rspam-User: X-HE-Tag: 1724268891-935304 X-HE-Meta: U2FsdGVkX18qtfSoMRa5RBWMLxoT2uwEDK5sDiDH0XsEDSZboAVnIy1hTwT9go3FMagWJNHszbh6peUf84dvcxfDVpWSghSsYaUnRRnHW4r5B0bFfPLHU9BZ4/QBtxEejHZ+faO3ei6g7RFsaSxT1SI6/U2C1gqkXMzzRz5uyNq3fnA9mQbhLlz1DtsG9QUrjAaE3GbBN4FYSl0IZ92K70ZJ6FE5jGYIsmfQlVilusK2bJtn5/6WUeDmpdUcN+UfWkcgfjVt5ylivVvGrDkppGPl4HSsjxZPKZ3/twrTS73a6O0Lwg6PWmESNyS0TLzNTkNjQbH5klCQn30FxLCZiBtWbJcLSO1UMeDJ6RsT3xovVKeALlnok+9+eG+FI/Hhu5NB+xeXYwrYYG9znZBKaDwqIScrlcL/XwXywXtiZgqcW6svLrDV0p4MFALCCMSIdx0c8NABe0L+W7chD/icEU2r6xf8sqsMOc30GztZw1g992eWNl8H1VnQ9X0xP5LEEbnFPuVu3JdSUcrKvs+qqC294mtRE8EDwLqUWTgIFyxrM1MdeX7yc3nDU5ypVa1gKFUqRS34qut7ip/r9UnVfU9RFiL9Hv60pp/Ty/ncySbTk3rPeh20PduD5n3V+g4yL434L/crtMjof7Guye0g9rxZ6ZCVhA6ow1R+qBPJxDX7oCVnKd7d+kHOVSCfLzJvCAMN42i1PYMg8ThZ+18e3F+k9QnXCoD1d815TaqhzMZSWTE+icj/LhkqePIIASgxmvMfbINco/2rWfx4S1tMmbHEFnp4JeXuLztqLjN3iDa/6Eu/ubV5dUllguPfNSGxOiHlo7SC3MUg+U9qb73NOhq16mHopF4vTI0VAx6qT2V2oMAlQjajCo0a3h/QBRPRSkka2BBrJCZq1ZSnUQyUdChxABZZEeWYrld1l1BOSEdTY9g40wn+KadP/xN+0lZBQ2fwmT82vaf9+xRW2CO mFx9+V5f wYQhHb2XEDEvxcR/eMAjJz4szjOFvT+F8/1axwS9ggmR14jyzRwPFHAw7Uv1Qk5ObU6GA7/ehxS+Y+BFBtQLlTtI3DhHzFkaHfIppNEtymgxkHN4kPwBjm81FjBVSh0ep74d5nDG+Z6KBrF4x3IWVmryiJr/T37xuwmERw662wCDm0Zm6dRqCg3xW0D8q71Jor1LKOYQIhG5edZ2ee81p69HmOw== 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: List-Subscribe: List-Unsubscribe: While there are many aliases for this flag, nobody actually uses the *PageOwnerPriv1() nor folio_*_owner_priv_1() accessors. Remove them. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/page-flags.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index f1358f86a673..5112049cc102 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -539,8 +539,6 @@ FOLIO_FLAG(swapbacked, FOLIO_HEAD_PAGE) */ PAGEFLAG(Private, private, PF_ANY) PAGEFLAG(Private2, private_2, PF_ANY) TESTSCFLAG(Private2, private_2, PF_ANY) -PAGEFLAG(OwnerPriv1, owner_priv_1, PF_ANY) - TESTCLEARFLAG(OwnerPriv1, owner_priv_1, PF_ANY) /* * Only test-and-set exist for PG_writeback. The unconditional operators are From patchwork Wed Aug 21 19:34:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13772017 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 CAC01C5321E for ; Wed, 21 Aug 2024 19:34:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0F7B76B0191; Wed, 21 Aug 2024 15:34:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0A78E6B0192; Wed, 21 Aug 2024 15:34:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E88686B0193; Wed, 21 Aug 2024 15:34:52 -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 C4F626B0191 for ; Wed, 21 Aug 2024 15:34:52 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 73174121175 for ; Wed, 21 Aug 2024 19:34:52 +0000 (UTC) X-FDA: 82477255224.24.D2037E0 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf26.hostedemail.com (Postfix) with ESMTP id B54FC140012 for ; Wed, 21 Aug 2024 19:34:50 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=aIrktxoI; spf=none (imf26.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724268810; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=w4IRfGFkiFrrB3pF7j3Lr77Y/eA+6+Dyb/+szPk1dX8=; b=AAwkgdUeAywoMLVYTE4k+qRVMl1AIrq23GGdcA6rNXO920FB/q20fuLRvf4+ubpQjGeQZY p+lqxKHgPrttyis/IqZnajHW+ltyBb2qergFI02jyCyI32y76mYYR7qNzW/GRYfsedy3s7 AaeoKZ6XMeL/qd09UkuoFaQCxZOPriE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724268810; a=rsa-sha256; cv=none; b=Ku9W7R2ILZP73iISJaOcPtWZlobuCOTYkYGFQ4hOwKoTXZCIbTTdHMIDRySirZPwNMTpmL w1ufkEf85EJo5ro0sTZUDA1v56E91U2jQvFOKw+w4UzemiEaea2N8wTa4FvFZY8QDOudzi Knr1PbRDrgCsGGvLzHzQ1FAutOqBF1w= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=aIrktxoI; spf=none (imf26.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=w4IRfGFkiFrrB3pF7j3Lr77Y/eA+6+Dyb/+szPk1dX8=; b=aIrktxoIwlcDGpbGt35aAZG/EM 3nrAiWG+k8rQ1VBGsAzOglgpYNVayUlM0N2pPxOtaoFUNUntpMNBBwpDjf0f33ogajeNZHPjC83vu NhLUdrCxnYatOroIT1+6AdQ82tooWlFaSRwtP9A2EY1o25FmxZioC9E4DMgz9WCryABX1OzVhTIug CMkM7EmHyGj47aoMJO6mSDreAhyHMpYjcaj+7ll5DRT5dycWWQr50fRo8Hi96+rtNBGcJcI4pKWqu RNcFEeN7pOZUIxUZIQ2dyYQlqKQLQy6EAZ4WKyaYDfM+VAVOYeN7Fq2H9NWuJ5PbqRMbmqeR7t40i DNsJT++g==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgr6V-00000009cqp-1w4I; Wed, 21 Aug 2024 19:34:47 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, x86@kernel.org Subject: [PATCH 08/10] mm: Remove page_has_private() Date: Wed, 21 Aug 2024 20:34:41 +0100 Message-ID: <20240821193445.2294269-9-willy@infradead.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240821193445.2294269-1-willy@infradead.org> References: <20240821193445.2294269-1-willy@infradead.org> MIME-Version: 1.0 X-Stat-Signature: uwatupbkhypp9eypuy4ryb1nh166pa6y X-Rspamd-Queue-Id: B54FC140012 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1724268890-456116 X-HE-Meta: U2FsdGVkX19vH+li/lvSyJoL30pSwKcdr5PUTGGE6/ES9q8/xJ59p+HuiPOGBn5Z1QXEW6CHN2ZM623GaPgZEDQPXDQ0yW6o/lgCGA7vzVTHVcmFr4LrSu0Xu2HEoGtKx38WBWP3Jht1m6MApW6fHuYQcbZ4nGiuGl5wNgI2NMWFmGWnfb2mV1DKvezH8KkWQa/xiyCWuBDDhOJbrQSlYxHv7CxY0TQmE5fspVeSIrbabXPJoSoilMiTSlwlOtnXwXhQaxXKNcwDc7m9C2ZHs+oUdL+glXKajP1luUzdYBbR2Xtn8RqKj5xMg5BJrP9dWe+II/1qLDEtt1I/es0w0G3Hw7u1TZTTfnMazNkFW6hsrcOdr5y3BzVoV4mccMMeoIPrxyYPV3KqVSlh2u47gQbxTnBAXiEC4c+fmVci4RXhcDOXBWWUAfXHcrFPjHEKWc5DTlPvIdGz9eWxXCADb1L64qNjhCfX+IiSuTt79Q2jV7mXkBJxZBTI+Q5xl/TA/2bBEycm5lVVJSWYYMpbAKZqzIfwlIsYLjC3bvGxjzxU/uch3jWxADw5i1w5wTKR0pEK4kDM62oHdzMAifFNMjE+B8I7yzG2itKwaN6fbqiClLhnz/iXG0A+KB6Jl+qtwxK/V0nW2WjBZ+oCBWTIogW07i1Iqhrz8UEtjAI/cpCY95iO+it/aeX8T/TQFW9zPdrWbNhrgRv0RLs5qB/9QIBBuSoZlHdgUzh5LpbbU7GSGxYjfRaq82QawH74SMEoJl0DkSeEBXNaTh+IRCafIbx8zK4oRd4SidLib2ghpRIJP1niUa3krlJCaUPCbjYnxXpJGuDjT/uXSknIXczrsGPFS0V//rLOv3VyrW66WYxb3XadKAXOAZYKVI8osJ69WtuxfsABXrUYzFW6YCw2aQY5wyYr0A0LFYpyy6Jf4oUJ01I4tt8ZSoPkNzVZDHqkw1E6hTTGpY54dTA+a/s fhzpgPY6 cbvbO1XC1leQM3vuoUFqSKw+kzZf9Upct6g00vGsxtxcfk0EYdJXLxMSi2TvkjHUCt9l5mycPc02Lptbr9cetSHbPuYCdHtjmXQjmh9breYIcY6qCyuZN2vZzzaBKBMb0Fq+AC1CLsxiu/NjujWjle3XRNk+ubDtI3j/AzInbEJ4DU/tjPvyvYiHuMvQpE8JDwyfSN1ia7B+uFtkLUON9HEbVr2T9sv516bayvi0/sscnyDqqLpTImdRn+gV+lqsFzss6 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: List-Subscribe: List-Unsubscribe: This function has no more callers, except folio_has_private(). Combine the two functions. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/page-flags.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 5112049cc102..3513aa666c31 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -1175,20 +1175,15 @@ static __always_inline void __ClearPageAnonExclusive(struct page *page) #define PAGE_FLAGS_PRIVATE \ (1UL << PG_private | 1UL << PG_private_2) /** - * page_has_private - Determine if page has private stuff - * @page: The page to be checked + * folio_has_private - Determine if folio has private stuff + * @folio: The folio to be checked * - * Determine if a page has private stuff, indicating that release routines + * Determine if a folio has private stuff, indicating that release routines * should be invoked upon it. */ -static inline int page_has_private(const struct page *page) +static inline int folio_has_private(const struct folio *folio) { - return !!(page->flags & PAGE_FLAGS_PRIVATE); -} - -static inline bool folio_has_private(const struct folio *folio) -{ - return page_has_private(&folio->page); + return !!(folio->flags & PAGE_FLAGS_PRIVATE); } #undef PF_ANY From patchwork Wed Aug 21 19:34:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13772016 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 9C249C52D7C for ; Wed, 21 Aug 2024 19:34:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 53C6C6B0185; Wed, 21 Aug 2024 15:34:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4C8DF6B0191; Wed, 21 Aug 2024 15:34:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 27A9A6B018F; Wed, 21 Aug 2024 15:34:52 -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 F2F546B0192 for ; Wed, 21 Aug 2024 15:34:51 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 9EAE9A1071 for ; Wed, 21 Aug 2024 19:34:51 +0000 (UTC) X-FDA: 82477255182.14.500A553 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf10.hostedemail.com (Postfix) with ESMTP id BE895C001F for ; Wed, 21 Aug 2024 19:34:49 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Vjof5RZh; spf=none (imf10.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724268783; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7V2bV5roZ/7Rqnt/F40jOHr7KxmrZpegYZisQPKdM5k=; b=rNQfbrG+PNS46TnLu4IsSdaek8bDom2k1mnor9upJSF47W4i5fi/7WCeWY/k8+8mmVPJYH /38RVkcqwiYaidQRW4Bx/ggqtV29q7vT3UMsZ3z6Cjn2SMsFcT454u2uBcacACxfhAyDeu 7TZobZ1zs4xS8+8qvx+qSl788Q8lQgE= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Vjof5RZh; spf=none (imf10.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724268783; a=rsa-sha256; cv=none; b=mGaMpT6mSd4yJfZcrcc6kXFlPRDz0txF9PjIs44zb4AnpznFyxdYnsVjFEL+FJLQgwf9En FXcV9t9RN7YoCCo1d4BAy1V1pDObArfotQSFcAC3eWgIF+rbjnICFILFsIjJBLIp1OMSDw RMCuwAuW5ugUS2I65Pw95+x3xs7Oupg= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=7V2bV5roZ/7Rqnt/F40jOHr7KxmrZpegYZisQPKdM5k=; b=Vjof5RZhhPS5QZIffxl8qmogr9 p70RfChVk3jAbVsrkyyxa7n4sXS9NhofK5bepKsqxla8i7NTXVFHk+Zumc9/MmDxFUAb3LEGFHfDk 5IjTtzIknToelA7DkoVqLwmITzeaTvYDzDz6g4sjXK0Y4eqp3AdKR0hc2mPW08uZB/FnbnTyzRMPi JPNKR3yeiJNtl+1GlSuhO+zVRw/yuZY8RREZIGCcEiOwEar60rvX2WkVw7tSi+L69D4AZ/ZVFscY3 /yi5TrjyT5nB9NhkChfB6uuhxFdgrCxDaBKNmbssd7f6bDTx4hdNG0NRMANPI+iSz+BD4nGQIE/UE 5BiCtH+w==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgr6V-00000009cr6-2vRi; Wed, 21 Aug 2024 19:34:47 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, x86@kernel.org Subject: [PATCH 09/10] mm: Rename PG_mappedtodisk to PG_owner_2 Date: Wed, 21 Aug 2024 20:34:42 +0100 Message-ID: <20240821193445.2294269-10-willy@infradead.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240821193445.2294269-1-willy@infradead.org> References: <20240821193445.2294269-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: BE895C001F X-Stat-Signature: 3dzwm9jwgitkatidsboaoudf11b1y6m1 X-Rspam-User: X-HE-Tag: 1724268889-273116 X-HE-Meta: U2FsdGVkX1+xK3XDMygOcvR4tgJeM/UlcJ/0CVvibQsr0rV6HJ5FjIR7mIZwIusPYPyU4ErAfbVS5+iLtaHo+Imy5ZZfsVBq1ufsUgTCIiv5UK+WBPgjrpqm4oB4ZrjMtWXenpd4ds9q+TMRVOuYXaCN4cIKpRuAcwzOLmTrwMkSwlndqXML50kwtSLgYOsCTTteXUreBYdzNzB02Eew3KCekEDpZOTTx8rI7Phz3MH8fTzdGB8cYAU9HGf+0OvWCKzmSZ5zvVgelyOvOelsece+3m6+HRh07zdM+xrC+7+W0PcWAX/YOffeBQ+g1GaadrQ77Xl436LhKKqlAGZRCp0yBkXanWtoH0ZmraYUWthrXMnm8VFfz3Wu/jji+cKJ86Tmkqw2jYZZ0ak3QfcmmUFH9wYJfVplzK0LpHXiDERdG1SVHIXvf0LAELT2MLfhWOuQQsg+GjKKd29z4cyZDj3kFhOefVN1qxkfeZjZfWU9N4CL0vXAXk49p5dsw7qCqEwcvFnrQbvAUmhTNtfaV4zK+aFdYty6KEfPnfupn8lcfO9AIUImTgb9N77IO3xyxepdvkHGGOkxAeoUSTBBFNtk+yduM5+6s1rMqr4Fdj2hHcHaPCI7H3Y7lpCRVTbHBUWFuOg3h1N3bzoHmWdYUQEJogDyPi5loiAAxF7v1DygbThpIJgUlfybTsnvbIPri/Ph48Pl/tS+BkZuN7FKjthQbFOeqQCnOn2urxi1ZsY10AfU/86hCw18cb4C4UCC5tmMmHfZEBNkc4rhNXnpfj+6ixWruz7tHgTkNRNkLaGDIowauwZWLmB4/VXqmyGfPRon44Z4MYIePj79Fc/X5KRlM07AnSSti9mwKvZlA+kRt48afkhMPYuIXzyFwAGLr/ERGPyp4zW9pHhzMyyVVPdaIiD1/tB6L2kRBOsP7gwgv0H85zJKUXEF8sq4869cVjxx17inTusK3fvQavQ 4L2mDAX0 +jHOdQJvgx4dxyEGV6iQz73gk0U8Is/XgWFSB2ZuLa8P7y1EVroJvuZ/+t6FacBIJ876Go/kh7kPuEMP6Qd3TS+f8UseAiVAVi7qkN2MRRjyMrkBGcSX7Aim7gusN0Sl0+HpBW0FVCIKBOZucWJLX4etnEp58oun5txSSA0cs3ovVrUpRn21JXkmD/rmI53JaS3SYbmKK2gF12qtHuZ4nF5ssPa0OjNht6LFwg1NAxBcXEPsGHAWcQoYCsc+G7vamU1zEvW3e6pGV6yM= 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: List-Subscribe: List-Unsubscribe: This flag has similar constraints to PG_owner_priv_1 -- it is ignored by core code, and is entirely for the use of the code which allocated the folio. Since the pagecache does not use it, individual filesystems can use it. The bufferhead code does use it, so filesystems which use the buffer cache must not use it for another purpose. Signed-off-by: Matthew Wilcox (Oracle) --- fs/proc/page.c | 2 +- include/linux/kernel-page-flags.h | 2 +- include/linux/page-flags.h | 24 ++++++++++++++++-------- include/trace/events/mmflags.h | 2 +- tools/mm/page-types.c | 10 +++++----- 5 files changed, 24 insertions(+), 16 deletions(-) diff --git a/fs/proc/page.c b/fs/proc/page.c index 73a0f872d97f..e74e639893be 100644 --- a/fs/proc/page.c +++ b/fs/proc/page.c @@ -211,7 +211,7 @@ u64 stable_page_flags(const struct page *page) #endif u |= kpf_copy_bit(k, KPF_RESERVED, PG_reserved); - u |= kpf_copy_bit(k, KPF_MAPPEDTODISK, PG_mappedtodisk); + u |= kpf_copy_bit(k, KPF_OWNER_2, PG_owner_2); u |= kpf_copy_bit(k, KPF_PRIVATE, PG_private); u |= kpf_copy_bit(k, KPF_PRIVATE_2, PG_private_2); u |= kpf_copy_bit(k, KPF_OWNER_PRIVATE, PG_owner_priv_1); diff --git a/include/linux/kernel-page-flags.h b/include/linux/kernel-page-flags.h index 859f4b0c1b2b..7c587a711be1 100644 --- a/include/linux/kernel-page-flags.h +++ b/include/linux/kernel-page-flags.h @@ -10,7 +10,7 @@ */ #define KPF_RESERVED 32 #define KPF_MLOCKED 33 -#define KPF_MAPPEDTODISK 34 +#define KPF_OWNER_2 34 #define KPF_PRIVATE 35 #define KPF_PRIVATE_2 36 #define KPF_OWNER_PRIVATE 37 diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 3513aa666c31..c001e3c29c4c 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -101,12 +101,12 @@ enum pageflags { PG_waiters, /* Page has waiters, check its waitqueue. Must be bit #7 and in the same byte as "PG_locked" */ PG_active, PG_workingset, - PG_owner_priv_1, /* Owner use. If pagecache, fs may use*/ + PG_owner_priv_1, /* Owner use. If pagecache, fs may use */ + PG_owner_2, /* Owner use. If pagecache, fs may use */ PG_arch_1, PG_reserved, PG_private, /* If pagecache, has fs-private data */ PG_private_2, /* If pagecache, has fs aux data */ - PG_mappedtodisk, /* Has blocks allocated on-disk */ PG_reclaim, /* To be reclaimed asap */ PG_swapbacked, /* Page is backed by RAM/swap */ PG_unevictable, /* Page is "unevictable" */ @@ -131,6 +131,11 @@ enum pageflags { PG_readahead = PG_reclaim, + /* Anonymous memory (and shmem) */ + PG_swapcache = PG_owner_priv_1, /* Swap page: swp_entry_t in private */ + /* Some filesystems */ + PG_checked = PG_owner_priv_1, + /* * Depending on the way an anonymous folio can be mapped into a page * table (e.g., single PMD/PUD/CONT of the head page vs. PTE-mapped @@ -138,13 +143,13 @@ enum pageflags { * tail pages of an anonymous folio. For now, we only expect it to be * set on tail pages for PTE-mapped THP. */ - PG_anon_exclusive = PG_mappedtodisk, - - /* Filesystems */ - PG_checked = PG_owner_priv_1, + PG_anon_exclusive = PG_owner_2, - /* SwapBacked */ - PG_swapcache = PG_owner_priv_1, /* Swap page: swp_entry_t in private */ + /* + * Set if all buffer heads in the folio are mapped. + * Filesystems which do not use BHs can use it for their own purpose. + */ + PG_mappedtodisk = PG_owner_2, /* Two page bits are conscripted by FS-Cache to maintain local caching * state. These bits are set on pages belonging to the netfs's inodes @@ -540,6 +545,9 @@ FOLIO_FLAG(swapbacked, FOLIO_HEAD_PAGE) PAGEFLAG(Private, private, PF_ANY) PAGEFLAG(Private2, private_2, PF_ANY) TESTSCFLAG(Private2, private_2, PF_ANY) +/* owner_2 can be set on tail pages for anon memory */ +FOLIO_FLAG(owner_2, FOLIO_HEAD_PAGE) + /* * Only test-and-set exist for PG_writeback. The unconditional operators are * risky: they bypass page accounting. diff --git a/include/trace/events/mmflags.h b/include/trace/events/mmflags.h index c151cc21d367..3b51558cdc9b 100644 --- a/include/trace/events/mmflags.h +++ b/include/trace/events/mmflags.h @@ -107,13 +107,13 @@ DEF_PAGEFLAG_NAME(active), \ DEF_PAGEFLAG_NAME(workingset), \ DEF_PAGEFLAG_NAME(owner_priv_1), \ + DEF_PAGEFLAG_NAME(owner_2), \ DEF_PAGEFLAG_NAME(arch_1), \ DEF_PAGEFLAG_NAME(reserved), \ DEF_PAGEFLAG_NAME(private), \ DEF_PAGEFLAG_NAME(private_2), \ DEF_PAGEFLAG_NAME(writeback), \ DEF_PAGEFLAG_NAME(head), \ - DEF_PAGEFLAG_NAME(mappedtodisk), \ DEF_PAGEFLAG_NAME(reclaim), \ DEF_PAGEFLAG_NAME(swapbacked), \ DEF_PAGEFLAG_NAME(unevictable) \ diff --git a/tools/mm/page-types.c b/tools/mm/page-types.c index 8d5595b6c59f..8ca41c41105e 100644 --- a/tools/mm/page-types.c +++ b/tools/mm/page-types.c @@ -71,7 +71,7 @@ /* [32-] kernel hacking assistances */ #define KPF_RESERVED 32 #define KPF_MLOCKED 33 -#define KPF_MAPPEDTODISK 34 +#define KPF_OWNER_2 34 #define KPF_PRIVATE 35 #define KPF_PRIVATE_2 36 #define KPF_OWNER_PRIVATE 37 @@ -129,7 +129,7 @@ static const char * const page_flag_names[] = { [KPF_RESERVED] = "r:reserved", [KPF_MLOCKED] = "m:mlocked", - [KPF_MAPPEDTODISK] = "d:mappedtodisk", + [KPF_OWNER_2] = "d:owner_2", [KPF_PRIVATE] = "P:private", [KPF_PRIVATE_2] = "p:private_2", [KPF_OWNER_PRIVATE] = "O:owner_private", @@ -472,9 +472,9 @@ static int bit_mask_ok(uint64_t flags) static uint64_t expand_overloaded_flags(uint64_t flags, uint64_t pme) { - /* Anonymous pages overload PG_mappedtodisk */ - if ((flags & BIT(ANON)) && (flags & BIT(MAPPEDTODISK))) - flags ^= BIT(MAPPEDTODISK) | BIT(ANON_EXCLUSIVE); + /* Anonymous pages use PG_owner_2 for anon_exclusive */ + if ((flags & BIT(ANON)) && (flags & BIT(OWNER_2))) + flags ^= BIT(OWNER_2) | BIT(ANON_EXCLUSIVE); /* SLUB overloads several page flags */ if (flags & BIT(SLAB)) { From patchwork Wed Aug 21 19:34:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13772018 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 8698DC52D6F for ; Wed, 21 Aug 2024 19:34:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7FC196B0192; Wed, 21 Aug 2024 15:34:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 75C816B0193; Wed, 21 Aug 2024 15:34:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5FE1B6B0194; Wed, 21 Aug 2024 15:34:53 -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 35A776B0193 for ; Wed, 21 Aug 2024 15:34:53 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D309DC0FCA for ; Wed, 21 Aug 2024 19:34:52 +0000 (UTC) X-FDA: 82477255224.23.2395201 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf09.hostedemail.com (Postfix) with ESMTP id 236A5140029 for ; Wed, 21 Aug 2024 19:34:50 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=LpRahv8d; dmarc=none; spf=none (imf09.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724268826; a=rsa-sha256; cv=none; b=8l5rgDrZt/B1FWDF034UwycPUUuYLc9tM+JDzY+A11dGTyzEkqQGC1dAurXJMpjQPdkS21 fz4h5o/2/HRwvhyM3y0CrUPaVELdwl7L26r0w0SjjXpoBDzKQqxq8wPdd0FJL8mWyZU8Mn Q6TFMiMDC7uxwojxZwasSR59MunSf2g= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=LpRahv8d; dmarc=none; spf=none (imf09.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724268826; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=aoXvUmQZxLcraskxyzdekmS4BRurnqvUbN7H813e5kc=; b=Oo0jk6HDVX7lWflTHzej3ge9AKoycC8y8VI/A/UuTTvm9gMID4oc5Tva9Q3/r/wuLLfxuw xih/hUk8YXev7eKmuXgMF4n4sJv8LKrZhpjDhjhNVyzKKoVPEthhQAHg1NZTSGoyt3AQI7 q/22GONcc02efTOR+fPjZVOH0yiWslw= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=aoXvUmQZxLcraskxyzdekmS4BRurnqvUbN7H813e5kc=; b=LpRahv8dh1ob/VeW17tRjYPGpG igxvOqSKuTJD3wIFuIWQne6MAKif/tVHp0+fs268oqusqfJAbKjr2vUpV85Caym9W7bQRbzcS9W9m oaINq9hAOpBYVA5vUaFii9Rjgr0ynO9qawSf/BiD1Dh3OUp5bAfRI1jLdarXXYjhIFFInPlySpvCO O6jBWft+rQho+uQTUDmEAUDY2CYWjW4ONBONFZx5nswQfDpuulqgM447ZndGjnSiDQTM9+JVdOjFO ifbPlb5p5ejYZnODgJN790oIjfw2LFPW1RvntCfRzf/4a/pAgv+JUqBATUl0bUJ9U7UpZFfdfcZpk b0Ijj6/A==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgr6V-00000009crE-3TtL; Wed, 21 Aug 2024 19:34:47 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, x86@kernel.org Subject: [PATCH 10/10] x86: Remove PG_uncached Date: Wed, 21 Aug 2024 20:34:43 +0100 Message-ID: <20240821193445.2294269-11-willy@infradead.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240821193445.2294269-1-willy@infradead.org> References: <20240821193445.2294269-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 236A5140029 X-Stat-Signature: k8i31fi8iyte95usxcb88himkxum4t9x X-Rspam-User: X-HE-Tag: 1724268890-151973 X-HE-Meta: U2FsdGVkX1+MpvQV/3aoi3k9SKNk7/4FA/a0hxL0bFfJRwQ3GhuHVTsRz3Xnfz+ME7q1smvd3hwhHTIplCfmX6qzIZlYRFon8J+rTWPsNWdrc0S1UMpXaLXXUFx9zZA6e+2i0s/cmKYtGrNgFFS0zELJXW3gqwmLSTeDeqSrxdMz0KQ0Xq6cv2sAu650M8kOyftGB/9MhItuzpcom93lS4lArAV3zstpBrquTnABqhI+CV4uw7xjP7umwwRrtTdRLibh0Ed95AIUIxSHqC5jvEZgnab5z/0MOVhZoaM3LSjLZUmE3KmOEWjyN5Ts6C4alvJkuGmrRpJWakvLqkO4sEdQ/18iWgVN9uLAOiAPEUIUW3ls09fs+9bgzIIdJ/BJTDvqloQkQj0sFmNOoLt0F91Ewt/N/IQsepFJIZ8AwSroqZomNmJzxcr+AJUABe192zOpEieTJBHEtX2q4b2YYunYvKLri48OrLg6WmeIvr2tMstXQJZXAkVpK8Qdx13fQshHCYpWIG92eOMv/XeA2yjKlMoRJSAuushJXt5ljyiRV1n5nPE6ddxDGhcnC07TvZXffIC2Mbj5kBmcn0m3QsSmF9S716p2Pm/M/jiW3hQULWV81l7H1vNCwl7J/1wt8VKmG/d4FU7xd+Do+rF8oHiHWm4bK5XERGi+k8mWeJ3Cpfj22ob9moi2O0Wqe/o5zCxn3sEl+l8y9k5Wb4abURiTtD1MhOgS88hBFc9i69HEG1XfZZsK9SJNSKjqR1pnYO/Tm+S/fKz4J33uKiXD4zbNg0MTWNMtZPFCotpqUQ8iPmx9fgUMfrN8Rv6FGMyUp8Ht0t6VUQzfWXNRm+yQ3dp0rk/grGjyBLf+zo7/rsBHqROvHdv8L4Ly42rVBtOMlQ+cDKdjp9d5G7RfsoA96iFwDlG3ZHqPX9kAxtMRdVjzruvism7iuInQOtf+9INNrnaortSO1UJm6Xxxswa wiOWMTUL RZF36HEDzxAP/DMwulE6sQecXntKKImIl5YC20/c1JgC5YAAUrnRmsu3cgNWnBNwxVC3hlnqqOu28YMc8jZk6zNWhhHw1bkmvWO+3VywsXPRh9LZHcFJQhOE7vgkrRj2sZY+oKx0zgRsrAJCx1nPxJ0YhcDoKvvKiFzlxOepChyJ09up6c30ZmTe8gfvRXP8mD7KnCbzzLRUh+/HG04Qw8hJTPrHfNZBbNwWl/PI5xip0PSziD1OUBHQ51HJEf/i870Fw0Fn2j6t3Gdg= 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: List-Subscribe: List-Unsubscribe: Convert x86 to use PG_arch_2 instead of PG_uncached and remove PG_uncached. Signed-off-by: Matthew Wilcox (Oracle) --- .../features/vm/PG_uncached/arch-support.txt | 30 ------------------- arch/arm64/Kconfig | 3 +- arch/x86/Kconfig | 5 +--- arch/x86/mm/pat/memtype.c | 8 ++--- fs/proc/page.c | 8 ++--- include/linux/kernel-page-flags.h | 1 - include/linux/page-flags.h | 13 ++------ include/trace/events/mmflags.h | 23 +++++++------- mm/Kconfig | 9 ++---- mm/huge_memory.c | 4 ++- tools/mm/page-types.c | 3 +- 11 files changed, 31 insertions(+), 76 deletions(-) delete mode 100644 Documentation/features/vm/PG_uncached/arch-support.txt diff --git a/Documentation/features/vm/PG_uncached/arch-support.txt b/Documentation/features/vm/PG_uncached/arch-support.txt deleted file mode 100644 index 5a7508b8c967..000000000000 --- a/Documentation/features/vm/PG_uncached/arch-support.txt +++ /dev/null @@ -1,30 +0,0 @@ -# -# Feature name: PG_uncached -# Kconfig: ARCH_USES_PG_UNCACHED -# description: arch supports the PG_uncached page flag -# - ----------------------- - | arch |status| - ----------------------- - | alpha: | TODO | - | arc: | TODO | - | arm: | TODO | - | arm64: | TODO | - | csky: | TODO | - | hexagon: | TODO | - | loongarch: | TODO | - | m68k: | TODO | - | microblaze: | TODO | - | mips: | TODO | - | nios2: | TODO | - | openrisc: | TODO | - | parisc: | TODO | - | powerpc: | TODO | - | riscv: | TODO | - | s390: | TODO | - | sh: | TODO | - | sparc: | TODO | - | um: | TODO | - | x86: | ok | - | xtensa: | TODO | - ----------------------- diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index a2f8ff354ca6..6494848019a0 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -2100,7 +2100,8 @@ config ARM64_MTE depends on ARM64_PAN select ARCH_HAS_SUBPAGE_FAULTS select ARCH_USES_HIGH_VMA_FLAGS - select ARCH_USES_PG_ARCH_X + select ARCH_USES_PG_ARCH_2 + select ARCH_USES_PG_ARCH_3 help Memory Tagging (part of the ARMv8.5 Extensions) provides architectural support for run-time, always-on detection of diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 09f8fbcfe000..42edf11f5166 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1800,6 +1800,7 @@ config X86_PAT def_bool y prompt "x86 PAT support" if EXPERT depends on MTRR + select ARCH_USES_PG_ARCH_2 help Use PAT attributes to setup page level cache control. @@ -1811,10 +1812,6 @@ config X86_PAT If unsure, say Y. -config ARCH_USES_PG_UNCACHED - def_bool y - depends on X86_PAT - config X86_UMIP def_bool y prompt "User Mode Instruction Prevention" if EXPERT diff --git a/arch/x86/mm/pat/memtype.c b/arch/x86/mm/pat/memtype.c index bdc2a240c2aa..1fa0bf6ed295 100644 --- a/arch/x86/mm/pat/memtype.c +++ b/arch/x86/mm/pat/memtype.c @@ -104,7 +104,7 @@ __setup("debugpat", pat_debug_setup); #ifdef CONFIG_X86_PAT /* - * X86 PAT uses page flags arch_1 and uncached together to keep track of + * X86 PAT uses page flags arch_1 and arch_2 together to keep track of * memory type of pages that have backing page struct. * * X86 PAT supports 4 different memory types: @@ -118,9 +118,9 @@ __setup("debugpat", pat_debug_setup); #define _PGMT_WB 0 #define _PGMT_WC (1UL << PG_arch_1) -#define _PGMT_UC_MINUS (1UL << PG_uncached) -#define _PGMT_WT (1UL << PG_uncached | 1UL << PG_arch_1) -#define _PGMT_MASK (1UL << PG_uncached | 1UL << PG_arch_1) +#define _PGMT_UC_MINUS (1UL << PG_arch_2) +#define _PGMT_WT (1UL << PG_arch_2 | 1UL << PG_arch_1) +#define _PGMT_MASK (1UL << PG_arch_2 | 1UL << PG_arch_1) #define _PGMT_CLEAR_MASK (~_PGMT_MASK) static inline enum page_cache_mode get_page_memtype(struct page *pg) diff --git a/fs/proc/page.c b/fs/proc/page.c index e74e639893be..a55f5acefa97 100644 --- a/fs/proc/page.c +++ b/fs/proc/page.c @@ -206,18 +206,16 @@ u64 stable_page_flags(const struct page *page) u |= kpf_copy_bit(page->flags, KPF_HWPOISON, PG_hwpoison); #endif -#ifdef CONFIG_ARCH_USES_PG_UNCACHED - u |= kpf_copy_bit(k, KPF_UNCACHED, PG_uncached); -#endif - u |= kpf_copy_bit(k, KPF_RESERVED, PG_reserved); u |= kpf_copy_bit(k, KPF_OWNER_2, PG_owner_2); u |= kpf_copy_bit(k, KPF_PRIVATE, PG_private); u |= kpf_copy_bit(k, KPF_PRIVATE_2, PG_private_2); u |= kpf_copy_bit(k, KPF_OWNER_PRIVATE, PG_owner_priv_1); u |= kpf_copy_bit(k, KPF_ARCH, PG_arch_1); -#ifdef CONFIG_ARCH_USES_PG_ARCH_X +#ifdef CONFIG_ARCH_USES_PG_ARCH_2 u |= kpf_copy_bit(k, KPF_ARCH_2, PG_arch_2); +#endif +#ifdef CONFIG_ARCH_USES_PG_ARCH_3 u |= kpf_copy_bit(k, KPF_ARCH_3, PG_arch_3); #endif diff --git a/include/linux/kernel-page-flags.h b/include/linux/kernel-page-flags.h index 7c587a711be1..196778a087c4 100644 --- a/include/linux/kernel-page-flags.h +++ b/include/linux/kernel-page-flags.h @@ -15,7 +15,6 @@ #define KPF_PRIVATE_2 36 #define KPF_OWNER_PRIVATE 37 #define KPF_ARCH 38 -#define KPF_UNCACHED 39 #define KPF_SOFTDIRTY 40 #define KPF_ARCH_2 41 #define KPF_ARCH_3 42 diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index c001e3c29c4c..7b90a700b26a 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -113,9 +113,6 @@ enum pageflags { #ifdef CONFIG_MMU PG_mlocked, /* Page is vma mlocked */ #endif -#ifdef CONFIG_ARCH_USES_PG_UNCACHED - PG_uncached, /* Page has been mapped as uncached */ -#endif #ifdef CONFIG_MEMORY_FAILURE PG_hwpoison, /* hardware poisoned page. Don't touch */ #endif @@ -123,8 +120,10 @@ enum pageflags { PG_young, PG_idle, #endif -#ifdef CONFIG_ARCH_USES_PG_ARCH_X +#ifdef CONFIG_ARCH_USES_PG_ARCH_2 PG_arch_2, +#endif +#ifdef CONFIG_ARCH_USES_PG_ARCH_3 PG_arch_3, #endif __NR_PAGEFLAGS, @@ -602,12 +601,6 @@ FOLIO_FLAG_FALSE(mlocked) FOLIO_TEST_SET_FLAG_FALSE(mlocked) #endif -#ifdef CONFIG_ARCH_USES_PG_UNCACHED -PAGEFLAG(Uncached, uncached, PF_NO_COMPOUND) -#else -PAGEFLAG_FALSE(Uncached, uncached) -#endif - #ifdef CONFIG_MEMORY_FAILURE PAGEFLAG(HWPoison, hwpoison, PF_ANY) TESTSCFLAG(HWPoison, hwpoison, PF_ANY) diff --git a/include/trace/events/mmflags.h b/include/trace/events/mmflags.h index 3b51558cdc9b..58f2699331b6 100644 --- a/include/trace/events/mmflags.h +++ b/include/trace/events/mmflags.h @@ -71,12 +71,6 @@ #define IF_HAVE_PG_MLOCK(_name) #endif -#ifdef CONFIG_ARCH_USES_PG_UNCACHED -#define IF_HAVE_PG_UNCACHED(_name) ,{1UL << PG_##_name, __stringify(_name)} -#else -#define IF_HAVE_PG_UNCACHED(_name) -#endif - #ifdef CONFIG_MEMORY_FAILURE #define IF_HAVE_PG_HWPOISON(_name) ,{1UL << PG_##_name, __stringify(_name)} #else @@ -89,10 +83,16 @@ #define IF_HAVE_PG_IDLE(_name) #endif -#ifdef CONFIG_ARCH_USES_PG_ARCH_X -#define IF_HAVE_PG_ARCH_X(_name) ,{1UL << PG_##_name, __stringify(_name)} +#ifdef CONFIG_ARCH_USES_PG_ARCH_2 +#define IF_HAVE_PG_ARCH_2(_name) ,{1UL << PG_##_name, __stringify(_name)} +#else +#define IF_HAVE_PG_ARCH_2(_name) +#endif + +#ifdef CONFIG_ARCH_USES_PG_ARCH_3 +#define IF_HAVE_PG_ARCH_3(_name) ,{1UL << PG_##_name, __stringify(_name)} #else -#define IF_HAVE_PG_ARCH_X(_name) +#define IF_HAVE_PG_ARCH_3(_name) #endif #define DEF_PAGEFLAG_NAME(_name) { 1UL << PG_##_name, __stringify(_name) } @@ -118,12 +118,11 @@ DEF_PAGEFLAG_NAME(swapbacked), \ DEF_PAGEFLAG_NAME(unevictable) \ IF_HAVE_PG_MLOCK(mlocked) \ -IF_HAVE_PG_UNCACHED(uncached) \ IF_HAVE_PG_HWPOISON(hwpoison) \ IF_HAVE_PG_IDLE(idle) \ IF_HAVE_PG_IDLE(young) \ -IF_HAVE_PG_ARCH_X(arch_2) \ -IF_HAVE_PG_ARCH_X(arch_3) +IF_HAVE_PG_ARCH_2(arch_2) \ +IF_HAVE_PG_ARCH_3(arch_3) #define show_page_flags(flags) \ (flags) ? __print_flags(flags, "|", \ diff --git a/mm/Kconfig b/mm/Kconfig index 5946dcdcaeda..8078a4b3c509 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -1079,13 +1079,10 @@ config ARCH_USES_HIGH_VMA_FLAGS config ARCH_HAS_PKEYS bool -config ARCH_USES_PG_ARCH_X +config ARCH_USES_PG_ARCH_2 + bool +config ARCH_USES_PG_ARCH_3 bool - help - Enable the definition of PG_arch_x page flags with x > 1. Only - suitable for 64-bit architectures with CONFIG_FLATMEM or - CONFIG_SPARSEMEM_VMEMMAP enabled, otherwise there may not be - enough room for additional bits in page->flags. config VM_EVENT_COUNTERS default y diff --git a/mm/huge_memory.c b/mm/huge_memory.c index d92f19812c89..389d619845c9 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -3078,8 +3078,10 @@ static void __split_huge_page_tail(struct folio *folio, int tail, (1L << PG_workingset) | (1L << PG_locked) | (1L << PG_unevictable) | -#ifdef CONFIG_ARCH_USES_PG_ARCH_X +#ifdef CONFIG_ARCH_USES_PG_ARCH_2 (1L << PG_arch_2) | +#endif +#ifdef CONFIG_ARCH_USES_PG_ARCH_3 (1L << PG_arch_3) | #endif (1L << PG_dirty) | diff --git a/tools/mm/page-types.c b/tools/mm/page-types.c index 8ca41c41105e..fa050d5a48cd 100644 --- a/tools/mm/page-types.c +++ b/tools/mm/page-types.c @@ -76,7 +76,7 @@ #define KPF_PRIVATE_2 36 #define KPF_OWNER_PRIVATE 37 #define KPF_ARCH 38 -#define KPF_UNCACHED 39 +#define KPF_UNCACHED 39 /* unused */ #define KPF_SOFTDIRTY 40 #define KPF_ARCH_2 41 @@ -134,7 +134,6 @@ static const char * const page_flag_names[] = { [KPF_PRIVATE_2] = "p:private_2", [KPF_OWNER_PRIVATE] = "O:owner_private", [KPF_ARCH] = "h:arch", - [KPF_UNCACHED] = "c:uncached", [KPF_SOFTDIRTY] = "f:softdirty", [KPF_ARCH_2] = "H:arch_2",