mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xueyuan Chen <xueyuan.chen21@gmail.com>
To: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Nhat Pham <nphamcs@gmail.com>,
	Xueyuan Chen <xueyuan.chen@vivo.com>,
	 Barry Song <baohua@kernel.org>,
	Yosry Ahmed <yosry.ahmed@linux.dev>,
	 Johannes Weiner <hannes@cmpxchg.org>,
	Brian Geffon <bgeffon@google.com>,
	 Minchan Kim <minchan@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	 linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	xueyuan.chen21@gmail.com
Subject: Re: [RFC PATCH 0/2] mm: zsmalloc: make shrinker compaction budget-aware
Date: Mon, 02 Nov 2026 10:58:21 +0800	[thread overview]
Message-ID: <179358830137.300028.11084163850071476613.b4-reply@b4> (raw)
In-Reply-To: <auKlTdFbOZmAuheo@google.com>

On 2026-10-29 10:48 +0900, Sergey Senozhatsky wrote:
> On (26/10/29 10:43), Sergey Senozhatsky wrote:
> [..]
> > > Hmm we'd need to collect more data in our workloads to determine, but
> > > if we can compute compactable ratio (freeable_pages / total_pages) on
> > > a per size class basis, can we just skip the size class whose ratio is
> > > too bad? Would that at least cut down on the vast majority of
> > > fruitless memcpys and lock acquisitions etc?
> > > 
> > > I'm always a bit hesitant to over-rely on userspace, especially when
> > > kernel has information to do something smart about it. It might not
> > > react in time, and many proactive reclaiming schemes back off under
> > > heavy memory pressure.
> > 
> > Apologies for the delay.
> > 
> > The thing about shrinker compaction is that it's sort of on the
> > wrong end.  It doesn't trigger compaction when memory is plentiful,
> > no matter the internal fragmentation rate, and start firing compaction
> > scans when memory pressure hits.  The problem with this is that, now
> > compaction moves objects (if can compact zspages) and releases empty
> > zspages, in parallel with potentially heavy swapping out activities,
> > which can simply allocate those released pages back.  Which seems like
> > a useless exercise and needless memcpy-s.  So I was thinking about
> > either putting it under config or just removing it (this might be a
> > harder decision).
> 
> In embedded (android/bookOS/etc.) there is a daemon, that triggers
> various zram activities.  We can wire in pool-compaction (once under
> memory pressure), which is a zram sysfs device attribute, instead
> of pondering zsmalloc with scan callbacks.
> 

What triggering policy do you have in mind for the daemon?

If compaction is still triggered when the system is under memory
pressure, wouldn't it still overlap with heavy swap-out? The shrinker
can already run from kswapd, so moving it to a daemon alone would not
necessarily change that timing.



  reply	other threads:[~2026-11-02  2:58 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1786003779.git.xueyuan.chen@vivo.com>
2026-08-07  3:56 ` Sergey Senozhatsky
2026-08-07 10:57   ` Xueyuan Chen
2026-08-07 12:12     ` Sergey Senozhatsky
2026-08-07 16:25       ` Nhat Pham
2026-08-11  9:03         ` Xueyuan Chen
2026-08-11 16:25           ` Nhat Pham
2026-08-14 16:50             ` Xueyuan Chen
2026-08-18 12:11             ` Xueyuan Chen
2026-10-29  1:43         ` Sergey Senozhatsky
2026-10-29  1:48           ` Sergey Senozhatsky
2026-11-02  2:58             ` Xueyuan Chen [this message]
2026-11-04 18:06             ` Nhat Pham
2026-10-30  2:05           ` Xueyuan Chen
2026-10-29  2:26         ` Sergey Senozhatsky
2026-11-01 23:47           ` Sergey Senozhatsky
2026-11-02 20:24             ` Chris Wiseman
2026-11-04 17:57               ` Nhat Pham
2026-11-04 18:46                 ` Chris Wiseman
2026-11-04 21:54                   ` Nhat Pham
2026-11-05  1:10                     ` Xueyuan Chen
2026-11-05  5:05                       ` Sergey Senozhatsky
2026-11-05 13:36                         ` Chris Wiseman
2026-11-05 15:08                           ` Nhat Pham
2026-11-05 15:32                             ` Xueyuan Chen
2026-11-05 15:38                             ` Yosry Ahmed
2026-11-05 15:39                               ` Yosry Ahmed
2026-11-05 16:53                                 ` Chris Wiseman
2026-11-05 16:56                                   ` Yosry Ahmed
2026-11-05 15:24                         ` Xueyuan Chen
2026-11-05  5:01                     ` 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=179358830137.300028.11084163850071476613.b4-reply@b4 \
    --to=xueyuan.chen21@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=bgeffon@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=nphamcs@gmail.com \
    --cc=senozhatsky@chromium.org \
    --cc=xueyuan.chen@vivo.com \
    --cc=yosry.ahmed@linux.dev \
    /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®