From nobody Sun Feb 8 09:10:13 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93BA633EAFC; Thu, 18 Dec 2025 15:10:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766070603; cv=none; b=m2EXfxQVSf4+vMJ8CUUPU4lCRvYVxrdPVJKI75oDRzRPJFTWVqgreEhjUnpvRlsQllWSYkdRikiquiQ9LbSx/6smJ0MJi4utBnOWLdS3uEQXfY/dVCjc/j0OoS6P/DjRX2XzsCi39PVYg9pX8EEK65HFo6BGRZvgj6kPbSRsb3w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766070603; c=relaxed/simple; bh=xpVALRLGrlC3mdPn6EctNGLeNqovC9Y7xpC9d4Hifqo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WeEKWL+pSiOec8MPuQYmhz8VdkUJg/wX3AQzJCgsfyavTtBmJGbDdG52Lif/lj31jhUErKNGtOoN+4+pQut9xr+8hqYnUylOfgpZ/rmLOkiSgn7SHsxiZ2qLnnZ3tD1i5HrKi9y7M61lO/tjZrjp27s2BUorU51KZR3ZDwJi8vA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LkoW3Fct; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LkoW3Fct" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE6BCC19421; Thu, 18 Dec 2025 15:10:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766070603; bh=xpVALRLGrlC3mdPn6EctNGLeNqovC9Y7xpC9d4Hifqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LkoW3FctTcoQzT6GlDur/1mzo5wawRrQ8Pl/cnl1exw++199oKw1Cy1s1qxqiQMIg A9EqbhmFBAYG3FVmJDrktjHwCZ7g4JXi1wjuQyKHCfnABpNDNMogRF49E6C2zjcAyD mf4RBDievwEEqpaV2Ondj6Pix4bZuMey/tM9wYquc0yVBZggMVWFUuirpjO0Mf4Yrg 8qKlEZJjvRn4vEbdueXOJel8HoQ70ii5/nHgy1kTqc130CCuKKelXbib5UhDQGNZhR FUDRaqJ3ke9MZT7kZZomrmR9lz+nfkCevg69KKvY3TtjG+YQmHbBtQbHHpnJ1pmWIs Q1jUYjF1IYXyQ== Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfauth.phl.internal (Postfix) with ESMTP id 20747F40075; Thu, 18 Dec 2025 10:10:01 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Thu, 18 Dec 2025 10:10:01 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdegheejgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefmihhrhihlucfu hhhuthhsvghmrghuuceokhgrsheskhgvrhhnvghlrdhorhhgqeenucggtffrrghtthgvrh hnpefhudefjeehhfektdeuvdefveejffdvhfevtddugfduffejfeeikeelhedvtedvveen ucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehkihhrih hllhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudeiudduiedvieehhedq vdekgeeggeejvdekqdhkrghspeepkhgvrhhnvghlrdhorhhgsehshhhuthgvmhhovhdrnh grmhgvpdhnsggprhgtphhtthhopedvtddpmhhouggvpehsmhhtphhouhhtpdhrtghpthht oheprghkphhmsehlihhnuhigqdhfohhunhgurghtihhonhdrohhrghdprhgtphhtthhope hmuhgthhhunhdrshhonhhgsehlihhnuhigrdguvghvpdhrtghpthhtohepuggrvhhiuges khgvrhhnvghlrdhorhhgpdhrtghpthhtohepfihilhhlhiesihhnfhhrrgguvggrugdroh hrghdprhgtphhtthhopehushgrmhgrrghrihhfieegvdesghhmrghilhdrtghomhdprhgt phhtthhopehfvhgulhesghhoohhglhgvrdgtohhmpdhrtghpthhtohepohhsrghlvhgrug horhesshhushgvrdguvgdprhgtphhtthhopehrphhptheskhgvrhhnvghlrdhorhhgpdhr tghpthhtohepvhgsrggskhgrsehsuhhsvgdrtgii X-ME-Proxy: Feedback-ID: i10464835:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 18 Dec 2025 10:10:00 -0500 (EST) From: Kiryl Shutsemau To: Andrew Morton , Muchun Song , David Hildenbrand , Matthew Wilcox , Usama Arif , Frank van der Linden Cc: Oscar Salvador , Mike Rapoport , Vlastimil Babka , Lorenzo Stoakes , Zi Yan , Baoquan He , Michal Hocko , Johannes Weiner , Jonathan Corbet , kernel-team@meta.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Kiryl Shutsemau Subject: [PATCHv2 05/14] mm: Move set/clear_compound_head() next to compound_head() Date: Thu, 18 Dec 2025 15:09:36 +0000 Message-ID: <20251218150949.721480-6-kas@kernel.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251218150949.721480-1-kas@kernel.org> References: <20251218150949.721480-1-kas@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Move set_compound_head() and clear_compound_head() to be adjacent to the compound_head() function in page-flags.h. These functions encode and decode the same compound_info field, so keeping them together makes it easier to verify their logic is consistent, especially when the encoding changes. Signed-off-by: Kiryl Shutsemau Reviewed-by: Muchun Song --- include/linux/page-flags.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 72c933a43b6a..0de7db7efb00 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -290,6 +290,18 @@ static __always_inline unsigned long _compound_head(co= nst struct page *page) =20 #define compound_head(page) ((typeof(page))_compound_head(page)) =20 +static __always_inline void set_compound_head(struct page *page, + const struct page *head, + unsigned int order) +{ + WRITE_ONCE(page->compound_info, (unsigned long)head + 1); +} + +static __always_inline void clear_compound_head(struct page *page) +{ + WRITE_ONCE(page->compound_info, 0); +} + /** * page_folio - Converts from page to folio. * @p: The page. @@ -865,18 +877,6 @@ static inline bool folio_test_large(const struct folio= *folio) return folio_test_head(folio); } =20 -static __always_inline void set_compound_head(struct page *page, - const struct page *head, - unsigned int order) -{ - WRITE_ONCE(page->compound_info, (unsigned long)head + 1); -} - -static __always_inline void clear_compound_head(struct page *page) -{ - WRITE_ONCE(page->compound_info, 0); -} - #ifdef CONFIG_TRANSPARENT_HUGEPAGE static inline void ClearPageCompound(struct page *page) { --=20 2.51.2