From: Xueyuan Chen <xueyuan.chen21@gmail.com>
To: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Yosry Ahmed <yosry@kernel.org>, Nhat Pham <nphamcs@gmail.com>,
Barry Song <baohua@kernel.org>,
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-kernel@vger.kernel.org, linux-block@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [RFC PATCH 0/4] zsmalloc: replace shrinker with deferred compaction
Date: Fri, 04 Dec 2026 10:55:19 +0800 [thread overview]
Message-ID: <179635291992.1911544.5833379956441668587.b4-reply@b4> (raw)
In-Reply-To: <20261203101411.3609533-1-senozhatsky@chromium.org>
On 2026-12-03 19:13 +0900, Sergey Senozhatsky wrote:
> This is a follow-up to Chris's shrinker removal patch [1] and Barry's
> Pixel 6 fragmentation numbers [2].
>
> Removing the shrinker avoids mid-swap compaction stalls, but without
> any automatic compaction we risk regressing memory footprint on systems
> that do not run a userspace compaction daemon, and on systems that do
> proactive swap-out without hitting memory pressure (no shrinker
> triggers).
>
> Replace shrinker callbacks (now removed) with deferred threshold-based
> compaction in zsmalloc (plus a runtime-tunable zram sysfs knob to
> configure or disable it).
Hi Sergey,
I wonder if we could also consider cross-class reuse to reduce the
need for compaction.
In my Pixel 6 Pro workload, I observed that the 2048-byte class
grew by 3.5 MiB within a 2-second window while other size classes
had about 125 MiB of compactable memory.
When a class runs out of free objects, could we try allocating from
an existing zspage in a slightly larger class before allocating
a new zspage?
This would introduce some internal fragmentation, but might reduce
physical page allocations and object migration during compaction,
without changing the existing zspage layout or the allocation fast
path.
What do you think about this trade-off?
>
> Link: https://lore.kernel.org/linux-kernel/18ed2967f99a2eff.3137322e32332e3235332e313736.2c2157.0000sendgmr@google.com [1]
> Link: https://lore.kernel.org/linux-kernel/CAGsJ_4yoogQHpxGigawTfMPEKL_A6OkfEfsmJHzDHLPS3FCUQg@mail.gmail.com [2]
>
> Chris Wiseman (1):
> mm/zsmalloc: remove shrinker
>
> Sergey Senozhatsky (3):
> zsmalloc: introduce lockless zs_class_can_compact()
> zsmalloc: add deferred threshold compaction
> zram: add compact_threshold sysfs attribute
>
> Documentation/ABI/testing/sysfs-block-zram | 9 ++
> Documentation/admin-guide/blockdev/zram.rst | 2 +
> drivers/block/zram/zram_drv.c | 45 +++++++
> drivers/block/zram/zram_drv.h | 1 +
> include/linux/zsmalloc.h | 3 +
> mm/zsmalloc.c | 136 ++++++++++++--------
> 6 files changed, 142 insertions(+), 54 deletions(-)
>
> --
> 2.56.1.987.g2ec0ab4260-goog
>
>
next prev parent reply other threads:[~2026-12-04 2:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 10:13 Sergey Senozhatsky
2026-12-03 10:13 ` [RFC PATCH 1/4] mm/zsmalloc: remove shrinker Sergey Senozhatsky
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-03 10:13 ` [RFC PATCH 4/4] zram: add compact_threshold sysfs attribute Sergey Senozhatsky
2026-12-04 2:55 ` Xueyuan Chen [this message]
2026-12-04 3:49 ` [RFC PATCH 0/4] zsmalloc: replace shrinker with deferred compaction Sergey Senozhatsky
2026-12-06 6:37 ` Sergey Senozhatsky
2026-12-04 3:51 ` Sergey Senozhatsky
2026-12-05 8:57 ` Nanzhe Zhao
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=179635291992.1911544.5833379956441668587.b4-reply@b4 \
--to=xueyuan.chen21@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=bgeffon@google.com \
--cc=chengming.zhou@linux.dev \
--cc=hannes@cmpxchg.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=nphamcs@gmail.com \
--cc=nzzhao@126.com \
--cc=richardycc@google.com \
--cc=senozhatsky@chromium.org \
--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
all inboxes | Powered by JetHome®