From nobody Sat Feb 7 18:52:10 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 F3B0C21CC64; Mon, 19 Jan 2026 23:03:26 +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=1768863807; cv=none; b=ikWudK3vQhiEt0wzyw8nFDgjMLTn3mYO29L/nCnbzYJ1AwMl9cZbcZJzmWOKn1BhotHWgz98geNPi5cYaYl7yR9Tn6Io0fYmEUR9U33z+FfPgP+0Bqk2uZx4wpO7xLDnyZp4MMdXJ3YPnh/6sCaZiim+t5av7QCVDOh8dJRk6gI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768863807; c=relaxed/simple; bh=8Lw1LCv6YJ97mwCYs+lybDIcRNkq6gN9hctm9VzKy2M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YzmzLetNUNaoGoIAbtgPumd16CVnsSKkIvprcRKLeWhQ/mjwaWzLK63KD++IcdnuNcjvjbTyPp9OH2y7IciTFjbCMPPRSy6Ml4RLb9Jw23El6n4bZjugdwqTAOGz41HC0aPGQtM+5qg8LU8UvmhLsriRbinLgSVgOdq/wewJdFY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LmwfS+Wr; 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="LmwfS+Wr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0196C116C6; Mon, 19 Jan 2026 23:03:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768863806; bh=8Lw1LCv6YJ97mwCYs+lybDIcRNkq6gN9hctm9VzKy2M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LmwfS+WrZI/buk9JY+CG7Jfxa+mafIdXePK6bEkhmIlnJ+IMvH2Y8ZDXMtul2RIKG tAXnPAcwQ9mY6U9oV3qSMJOaVmCHgcjGnYuCxhCRZSwYTb+lL4rS8Qo84Phz8UcPUl BUsP/xpxRW5qZyDTKZ+LFa3DIy30EW3PFsZhLLEH3SHgxaY+qs3OoEVegAzEK5T5sP jnGj7Y/mfg3jJktddW1FJTE3RLD+7OGYSiYz42eQRca+mn/v8/pvZfZzxvTsu0fk68 nYoO4CGE6uAe3mWMicqWpFMVwdFxMeFFJzqGzfQzmNrDHTgvy1uUUUQP/KG6HfGtmu P4cf1xckiw3vA== From: "David Hildenbrand (Red Hat)" To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, Broadcom internal kernel review list , linux-doc@vger.kernel.org, virtualization@lists.linux.dev, "David Hildenbrand (Red Hat)" , Andrew Morton , Oscar Salvador , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jonathan Corbet , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Arnd Bergmann , Greg Kroah-Hartman , Jerrin Shaji George , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Zi Yan Subject: [PATCH v3 15/24] mm/balloon_compaction: move internal helpers to balloon_compaction.c Date: Tue, 20 Jan 2026 00:01:23 +0100 Message-ID: <20260119230133.3551867-16-david@kernel.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260119230133.3551867-1-david@kernel.org> References: <20260119230133.3551867-1-david@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" Let's move the helpers that are not required by drivers anymore. While at it, drop the doc of balloon_page_device() as it is trivial. Reviewed-by: Lorenzo Stoakes Acked-by: Michael S. Tsirkin Signed-off-by: David Hildenbrand (Red Hat) Reported-by: kernel test robot --- include/linux/balloon_compaction.h | 44 ------------------------------ mm/balloon_compaction.c | 38 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 44 deletions(-) diff --git a/include/linux/balloon_compaction.h b/include/linux/balloon_com= paction.h index d1d4739398978..eec8994056a44 100644 --- a/include/linux/balloon_compaction.h +++ b/include/linux/balloon_compaction.h @@ -75,48 +75,4 @@ static inline void balloon_devinfo_init(struct balloon_d= ev_info *balloon) balloon->migratepage =3D NULL; balloon->adjust_managed_page_count =3D false; } - -#ifdef CONFIG_BALLOON_COMPACTION -/* - * balloon_page_device - get the b_dev_info descriptor for the balloon dev= ice - * that enqueues the given page. - */ -static inline struct balloon_dev_info *balloon_page_device(struct page *pa= ge) -{ - return (struct balloon_dev_info *)page_private(page); -} -#endif /* CONFIG_BALLOON_COMPACTION */ - -/* - * balloon_page_insert - insert a page into the balloon's page list and ma= ke - * the page->private assignment accordingly. - * @balloon : pointer to balloon device - * @page : page to be assigned as a 'balloon page' - * - * Caller must ensure the balloon_pages_lock is held. - */ -static inline void balloon_page_insert(struct balloon_dev_info *balloon, - struct page *page) -{ - __SetPageOffline(page); - if (IS_ENABLED(CONFIG_BALLOON_COMPACTION)) { - SetPageMovableOps(page); - set_page_private(page, (unsigned long)balloon); - } - list_add(&page->lru, &balloon->pages); -} - -/* - * balloon_page_finalize - prepare a balloon page that was removed from the - * balloon list for release to the page allocator - * @page: page to be released to the page allocator - * - * Caller must ensure the balloon_pages_lock is held. - */ -static inline void balloon_page_finalize(struct page *page) -{ - if (IS_ENABLED(CONFIG_BALLOON_COMPACTION)) - set_page_private(page, 0); - /* PageOffline is sticky until the page is freed to the buddy. */ -} #endif /* _LINUX_BALLOON_COMPACTION_H */ diff --git a/mm/balloon_compaction.c b/mm/balloon_compaction.c index 1843e168db3ca..e0a4b481c3eda 100644 --- a/mm/balloon_compaction.c +++ b/mm/balloon_compaction.c @@ -17,6 +17,44 @@ */ static DEFINE_SPINLOCK(balloon_pages_lock); =20 +static struct balloon_dev_info *balloon_page_device(struct page *page) +{ + return (struct balloon_dev_info *)page_private(page); +} + +/* + * balloon_page_insert - insert a page into the balloon's page list and ma= ke + * the page->private assignment accordingly. + * @balloon : pointer to balloon device + * @page : page to be assigned as a 'balloon page' + * + * Caller must ensure the balloon_pages_lock is held. + */ +static void balloon_page_insert(struct balloon_dev_info *balloon, + struct page *page) +{ + __SetPageOffline(page); + if (IS_ENABLED(CONFIG_BALLOON_COMPACTION)) { + SetPageMovableOps(page); + set_page_private(page, (unsigned long)balloon); + } + list_add(&page->lru, &balloon->pages); +} + +/* + * balloon_page_finalize - prepare a balloon page that was removed from the + * balloon list for release to the page allocator + * @page: page to be released to the page allocator + * + * Caller must ensure the balloon_pages_lock is held. + */ +static void balloon_page_finalize(struct page *page) +{ + if (IS_ENABLED(CONFIG_BALLOON_COMPACTION)) + set_page_private(page, 0); + /* PageOffline is sticky until the page is freed to the buddy. */ +} + static void balloon_page_enqueue_one(struct balloon_dev_info *b_dev_info, struct page *page) { --=20 2.52.0