From: sashiko-bot@kernel.org
To: "Sergey Senozhatsky" <senozhatsky@chromium.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Yosry Ahmed" <yosry@kernel.org>, "Nhat Pham" <nphamcs@gmail.com>,
"Barry Song" <baohua@kernel.org>
Cc: "Brian Geffon" <bgeffon@google.com>,
"Minchan Kim" <minchan@kernel.org>,
"Richard Chang" <richardycc@google.com>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Chengming Zhou" <chengming.zhou@linux.dev>,
"Xueyuan Chen" <xueyuan.chen21@gmail.com>,
"Xueyuan Chen" <xueyuan.chen@vivo.com>,
"Nanzhe Zhao" <nzzhao@126.com>,
linux-mm@kvack.org
Subject: Re: [RFC PATCH 4/4] zram: add compact_threshold sysfs attribute
Date: Fri, 04 Dec 2026 10:14:38 +0000 [thread overview]
Message-ID: <sashiko-outbox-249582@kernel.org> (raw)
In-Reply-To: <20261203101411.3609533-5-senozhatsky@chromium.org>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] zram: compact_threshold ABI doc uses internal macro and omits
valid range
--
commit 45192552c92b313d87a6a0c3bbe74b27e88a52d9
Author: Sergey Senozhatsky <senozhatsky@chromium.org>
zram: add compact_threshold sysfs attribute
This commit adds a compact_threshold sysfs attribute for zram devices to
configure zsmalloc's deferred compaction threshold at runtime.
> diff --git a/Documentation/ABI/testing/sysfs-block-zram b/Documentation/ABI/testing/sysfs-block-zram
> index 1ea9018a627f2..84a924f4e8d28 100644
> --- a/Documentation/ABI/testing/sysfs-block-zram
> +++ b/Documentation/ABI/testing/sysfs-block-zram
> @@ -57,6 +57,15 @@ Description:
> allocator zrm uses. The allocator moves some objects so that
> it could free fragment space.
>
> +What: /sys/block/zram<id>/compact_threshold
> +Date: December 2026
> +Contact: Sergey Senozhatsky <senozhatsky@chromium.org>
> +Description:
> + The compact_threshold file is read-write and specifies the
> + zsmalloc pool fragmentation percentage threshold for deferred
> + background compaction. Default is ZS_DEFAULT_COMPACT_THRESHOLD;
> + "0" disables deferred compaction. Can be changed at runtime.
[Severity: Low]
Should this ABI documentation state the numeric default (5) instead of
the kernel-internal macro ZS_DEFAULT_COMPACT_THRESHOLD, and document the
valid 0-99 input range?
ZS_DEFAULT_COMPACT_THRESHOLD is defined in include/linux/zsmalloc.h and
is not exposed to userspace. In addition, compact_threshold_store()
rejects values >= 100 with -EINVAL, so users reading "percentage
threshold" without an upper bound will get an unexpected error if they
write 100.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203101411.3609533-1-senozhatsky@chromium.org?part=4
next prev parent reply other threads:[~2026-12-04 10:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 10:13 [RFC PATCH 0/4] zsmalloc: replace shrinker with deferred compaction Sergey Senozhatsky
2026-12-03 10:13 ` [RFC PATCH 1/4] mm/zsmalloc: remove shrinker Sergey Senozhatsky
2026-12-04 10:14 ` sashiko-bot
2026-12-03 10:13 ` [RFC PATCH 2/4] zsmalloc: introduce lockless zs_class_can_compact() Sergey Senozhatsky
2026-12-03 10:13 ` [RFC PATCH 3/4] zsmalloc: add deferred threshold compaction Sergey Senozhatsky
2026-12-04 10:14 ` sashiko-bot
2026-12-03 10:13 ` [RFC PATCH 4/4] zram: add compact_threshold sysfs attribute Sergey Senozhatsky
2026-12-04 10:14 ` sashiko-bot [this message]
2026-12-04 2:55 ` [RFC PATCH 0/4] zsmalloc: replace shrinker with deferred compaction Xueyuan Chen
2026-12-04 3:49 ` Sergey Senozhatsky
2026-12-04 3:51 ` Sergey Senozhatsky
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=sashiko-outbox-249582@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=bgeffon@google.com \
--cc=chengming.zhou@linux.dev \
--cc=hannes@cmpxchg.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=nphamcs@gmail.com \
--cc=nzzhao@126.com \
--cc=richardycc@google.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=senozhatsky@chromium.org \
--cc=xueyuan.chen21@gmail.com \
--cc=xueyuan.chen@vivo.com \
--cc=yosry@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