[PATCH 3/3] mm: zpdesc: minor naming and comment corrections

Johannes Weiner posted 3 patches 1 month ago
[PATCH 3/3] mm: zpdesc: minor naming and comment corrections
Posted by Johannes Weiner 1 month ago
zpdesc is the page descriptor used by the zsmalloc backend allocator,
which in turn is used by zswap and zram. The zpool layer is gone.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
---
 mm/zpdesc.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/mm/zpdesc.h b/mm/zpdesc.h
index 25bf5ea0beb8..b8258dc78548 100644
--- a/mm/zpdesc.h
+++ b/mm/zpdesc.h
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-/* zpdesc.h: zswap.zpool memory descriptor
+/* zpdesc.h: zsmalloc pool memory descriptor
  *
  * Written by Alex Shi <alexs@kernel.org>
  *	      Hyeonggon Yoo <42.hyeyoo@gmail.com>
@@ -11,14 +11,14 @@
 #include <linux/pagemap.h>
 
 /*
- * struct zpdesc -	Memory descriptor for zpool memory.
+ * struct zpdesc -	Memory descriptor for zsmalloc pool memory.
  * @flags:		Page flags, mostly unused by zsmalloc.
  * @lru:		Indirectly used by page migration.
  * @movable_ops:	Used by page migration.
- * @next:		Next zpdesc in a zspage in zsmalloc zpool.
- * @handle:		For huge zspage in zsmalloc zpool.
+ * @next:		Next zpdesc in a zspage in zsmalloc pool.
+ * @handle:		For huge zspage in zsmalloc pool.
  * @zspage:		Points to the zspage this zpdesc is a part of.
- * @first_obj_offset:	First object offset in zsmalloc zpool.
+ * @first_obj_offset:	First object offset in zsmalloc pool.
  * @_refcount:		The number of references to this zpdesc.
  *
  * This struct overlays struct page for now. Do not modify without a good
@@ -79,8 +79,8 @@ static_assert(sizeof(struct zpdesc) <= sizeof(struct page));
  * zpdesc_folio - The folio allocated for a zpdesc
  * @zp: The zpdesc.
  *
- * Zpdescs are descriptors for zpool memory. The zpool memory itself is
- * allocated as folios that contain the zpool objects, and zpdesc uses specific
+ * Zpdescs are descriptors for zsmalloc memory. The memory itself is allocated
+ * as folios that contain the zsmalloc objects, and zpdesc uses specific
  * fields in the first struct page of the folio - those fields are now accessed
  * by struct zpdesc.
  *
-- 
2.51.0
Re: [PATCH 3/3] mm: zpdesc: minor naming and comment corrections
Posted by Yosry Ahmed 3 weeks, 6 days ago
On Fri, Aug 29, 2025 at 05:15:28PM +0100, Johannes Weiner wrote:
> zpdesc is the page descriptor used by the zsmalloc backend allocator,
> which in turn is used by zswap and zram. The zpool layer is gone.
> 
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
> ---

Why not rename zpdesc to zsdesc or zdesc while we're at it? It's a lot
of noise but it's just this file and zsmalloc.c IIUC. Up to you.

If it's just the comment changes I would squash it into the second
patch, but not a big deal. Either way:

Acked-by: Yosry Ahmed <yosry.ahmed@linux.dev>

>  mm/zpdesc.h | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/mm/zpdesc.h b/mm/zpdesc.h
> index 25bf5ea0beb8..b8258dc78548 100644
> --- a/mm/zpdesc.h
> +++ b/mm/zpdesc.h
> @@ -1,5 +1,5 @@
>  /* SPDX-License-Identifier: GPL-2.0 */
> -/* zpdesc.h: zswap.zpool memory descriptor
> +/* zpdesc.h: zsmalloc pool memory descriptor
>   *
>   * Written by Alex Shi <alexs@kernel.org>
>   *	      Hyeonggon Yoo <42.hyeyoo@gmail.com>
> @@ -11,14 +11,14 @@
>  #include <linux/pagemap.h>
>  
>  /*
> - * struct zpdesc -	Memory descriptor for zpool memory.
> + * struct zpdesc -	Memory descriptor for zsmalloc pool memory.
>   * @flags:		Page flags, mostly unused by zsmalloc.
>   * @lru:		Indirectly used by page migration.
>   * @movable_ops:	Used by page migration.
> - * @next:		Next zpdesc in a zspage in zsmalloc zpool.
> - * @handle:		For huge zspage in zsmalloc zpool.
> + * @next:		Next zpdesc in a zspage in zsmalloc pool.
> + * @handle:		For huge zspage in zsmalloc pool.
>   * @zspage:		Points to the zspage this zpdesc is a part of.
> - * @first_obj_offset:	First object offset in zsmalloc zpool.
> + * @first_obj_offset:	First object offset in zsmalloc pool.
>   * @_refcount:		The number of references to this zpdesc.
>   *
>   * This struct overlays struct page for now. Do not modify without a good
> @@ -79,8 +79,8 @@ static_assert(sizeof(struct zpdesc) <= sizeof(struct page));
>   * zpdesc_folio - The folio allocated for a zpdesc
>   * @zp: The zpdesc.
>   *
> - * Zpdescs are descriptors for zpool memory. The zpool memory itself is
> - * allocated as folios that contain the zpool objects, and zpdesc uses specific
> + * Zpdescs are descriptors for zsmalloc memory. The memory itself is allocated
> + * as folios that contain the zsmalloc objects, and zpdesc uses specific
>   * fields in the first struct page of the folio - those fields are now accessed
>   * by struct zpdesc.
>   *
> -- 
> 2.51.0
>
Re: [PATCH 3/3] mm: zpdesc: minor naming and comment corrections
Posted by Johannes Weiner 3 weeks, 2 days ago
On Fri, Sep 05, 2025 at 07:05:22PM +0000, Yosry Ahmed wrote:
> On Fri, Aug 29, 2025 at 05:15:28PM +0100, Johannes Weiner wrote:
> > zpdesc is the page descriptor used by the zsmalloc backend allocator,
> > which in turn is used by zswap and zram. The zpool layer is gone.
> > 
> > Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
> > ---
> 
> Why not rename zpdesc to zsdesc or zdesc while we're at it? It's a lot
> of noise but it's just this file and zsmalloc.c IIUC. Up to you.

I'm kind of fine with zpdesc and not sure the other names are this
much better to warrant the churn. So if you don't mind, I'd just leave
it alone for now.

> If it's just the comment changes I would squash it into the second
> patch, but not a big deal. Either way:
> 
> Acked-by: Yosry Ahmed <yosry.ahmed@linux.dev>

Thanks for your review!
Re: [PATCH 3/3] mm: zpdesc: minor naming and comment corrections
Posted by Yosry Ahmed 3 weeks, 2 days ago
On Tue, Sep 09, 2025 at 04:11:13PM +0100, Johannes Weiner wrote:
> On Fri, Sep 05, 2025 at 07:05:22PM +0000, Yosry Ahmed wrote:
> > On Fri, Aug 29, 2025 at 05:15:28PM +0100, Johannes Weiner wrote:
> > > zpdesc is the page descriptor used by the zsmalloc backend allocator,
> > > which in turn is used by zswap and zram. The zpool layer is gone.
> > > 
> > > Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
> > > ---
> > 
> > Why not rename zpdesc to zsdesc or zdesc while we're at it? It's a lot
> > of noise but it's just this file and zsmalloc.c IIUC. Up to you.
> 
> I'm kind of fine with zpdesc and not sure the other names are this
> much better to warrant the churn. So if you don't mind, I'd just leave
> it alone for now.

I undestand there's churn involved, I am fine either way.

> 
> > If it's just the comment changes I would squash it into the second
> > patch, but not a big deal. Either way:
> > 
> > Acked-by: Yosry Ahmed <yosry.ahmed@linux.dev>
> 
> Thanks for your review!