lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aaf62122-364f-4bbf-91a1-28cfb3805c69@lucifer.local>
Date: Thu, 15 Jan 2026 12:32:22 +0000
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: "David Hildenbrand (Red Hat)" <david@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        linuxppc-dev@...ts.ozlabs.org,
        Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
        linux-doc@...r.kernel.org, virtualization@...ts.linux.dev,
        Andrew Morton <akpm@...ux-foundation.org>,
        Oscar Salvador <osalvador@...e.de>,
        "Liam R. Howlett" <Liam.Howlett@...cle.com>,
        Vlastimil Babka <vbabka@...e.cz>, Mike Rapoport <rppt@...nel.org>,
        Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>,
        Jonathan Corbet <corbet@....net>,
        Madhavan Srinivasan <maddy@...ux.ibm.com>,
        Michael Ellerman <mpe@...erman.id.au>,
        Nicholas Piggin <npiggin@...il.com>,
        Christophe Leroy <christophe.leroy@...roup.eu>,
        Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jerrin Shaji George <jerrin.shaji-george@...adcom.com>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Jason Wang <jasowang@...hat.com>,
        Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
        Eugenio Pérez <eperezma@...hat.com>,
        Zi Yan <ziy@...dia.com>
Subject: Re: [PATCH v2 14/23] mm/balloon_compaction: move internal helpers to
 balloon_compaction.c

On Thu, Jan 15, 2026 at 10:20:04AM +0100, David Hildenbrand (Red Hat) wrote:
> 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.
>
> Signed-off-by: David Hildenbrand (Red Hat) <david@...nel.org>

LGTM, with some nits below so:

Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>

> ---
>  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_compaction.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_dev_info *balloon)
>  	balloon->migratepage = NULL;
>  	balloon->adjust_managed_page_count = false;
>  }
> -
> -#ifdef CONFIG_BALLOON_COMPACTION
> -/*
> - * balloon_page_device - get the b_dev_info descriptor for the balloon device
> - *			 that enqueues the given page.
> - */
> -static inline struct balloon_dev_info *balloon_page_device(struct page *page)
> -{
> -	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 make
> - *			 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 709c57c00b481..717bc43732d09 100644
> --- a/mm/balloon_compaction.c
> +++ b/mm/balloon_compaction.c
> @@ -17,6 +17,44 @@
>   */
>  static DEFINE_SPINLOCK(balloon_pages_lock);
>
> +static inline struct balloon_dev_info *balloon_page_device(struct page *page)

NIT: inline here isn't needed.

> +{
> +	return (struct balloon_dev_info *)page_private(page);
> +}
> +
> +/*
> + * balloon_page_insert - insert a page into the balloon's page list and make
> + *			 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)

NIT: same as above.

> +{
> +	__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)

NIT: same as above.

> +{
> +	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)
>  {
> --
> 2.52.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ