Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
	Chengming Zhou <chengming.zhou@linux.dev>,
	Minchan Kim <minchan@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.6.y 8/9] zsmalloc: rename class stat mutators
Date: Fri,  4 Sep 2026 16:32:16 -0400	[thread overview]
Message-ID: <20260904203217.1548415-8-sashal@kernel.org> (raw)
In-Reply-To: <20260904203217.1548415-1-sashal@kernel.org>

From: Sergey Senozhatsky <senozhatsky@chromium.org>

[ Upstream commit 791abe1e420c3dad6ddbd0a6c40467e9e24059b7 ]

A cosmetic change.

o Rename class_stat_inc() and class_stat_dec() to class_stat_add()
  and class_stat_sub() correspondingly. inc/dec are usually associated
  with +1/-1 modifications, while zsmlloc can modify stats by up
  to ->objs_per_zspage. Use add/sub (follow atomics naming).

o Rename zs_stat_get() to class_stat_read()
  get() is usually associated with ref-counting and is paired with put().
  zs_stat_get() simply reads class stat so rename to reflect it.
  (This also follows atomics naming).

Link: https://lkml.kernel.org/r/20240701031140.3756345-1-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Reviewed-by: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: f7bf5cd5b5f2 ("zsmalloc: account for handle size in class lookup")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 mm/zsmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 1249cfa2b67f2..b63864f5fa398 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1873,7 +1873,7 @@ static void async_free_zspage(struct work_struct *work)
 
 		class = zspage_class(pool, zspage);
 		spin_lock(&class->lock);
-		class_stat_dec(class, ZS_INUSE_RATIO_0, 1);
+		class_stat_sub(class, ZS_INUSE_RATIO_0, 1);
 		__free_zspage(pool, class, zspage);
 		spin_unlock(&class->lock);
 	}
-- 
2.53.0


  parent reply	other threads:[~2026-09-04 20:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03 13:01 FAILED: patch "[PATCH] zsmalloc: account for handle size in class lookup" failed to apply to 6.6-stable tree gregkh
2026-09-04 20:32 ` [PATCH 6.6.y 1/9] mm/zsmalloc: remove migrate_write_lock_nested() Sasha Levin
2026-09-04 20:32   ` [PATCH 6.6.y 2/9] mm/zsmalloc: remove unused zspage->isolated Sasha Levin
2026-09-04 20:32   ` [PATCH 6.6.y 3/9] mm/zsmalloc: remove set_zspage_mapping() Sasha Levin
2026-09-04 20:32   ` [PATCH 6.6.y 4/9] mm/zsmalloc: remove_zspage() don't need fullness parameter Sasha Levin
2026-09-04 20:32   ` [PATCH 6.6.y 5/9] mm/zsmalloc: remove get_zspage_mapping() Sasha Levin
2026-09-04 20:32   ` [PATCH 6.6.y 6/9] mm/zsmalloc: change back to per-size_class lock Sasha Levin
2026-09-04 20:32   ` [PATCH 6.6.y 7/9] mm/zsmalloc: clarify class per-fullness zspage counts Sasha Levin
2026-09-04 20:32   ` Sasha Levin [this message]
2026-09-04 20:32   ` [PATCH 6.6.y 9/9] zsmalloc: account for handle size in class lookup Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260904203217.1548415-8-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=chengming.zhou@linux.dev \
    --cc=minchan@kernel.org \
    --cc=senozhatsky@chromium.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox