[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKEwX=MqsyWki+DfzePb3SwXWTZ_2tcDV-ONBQu62=otnBXCiQ@mail.gmail.com>
Date: Mon, 27 Oct 2025 15:46:10 -0700
From: Nhat Pham <nphamcs@...il.com>
To: jinji zhong <jinji.z.zhong@...il.com>
Cc: minchan@...nel.org, senozhatsky@...omium.org, philipp.reisner@...bit.com,
lars.ellenberg@...bit.com, christoph.boehmwalder@...bit.com, corbet@....net,
tj@...nel.org, hannes@...xchg.org, mkoutny@...e.com, axboe@...nel.dk,
mhocko@...nel.org, roman.gushchin@...ux.dev, shakeel.butt@...ux.dev,
akpm@...ux-foundation.org, terrelln@...com, dsterba@...e.com,
muchun.song@...ux.dev, linux-kernel@...r.kernel.org,
drbd-dev@...ts.linbit.com, linux-doc@...r.kernel.org, cgroups@...r.kernel.org,
linux-block@...r.kernel.org, linux-mm@...ck.org, zhongjinji@...or.com,
liulu.liu@...or.com, feng.han@...or.com,
YoungJun Park <youngjun.park@....com>
Subject: Re: [RFC PATCH 0/3] Introduce per-cgroup compression priority
On Sat, Oct 25, 2025 at 6:53 PM jinji zhong <jinji.z.zhong@...il.com> wrote:
>
> Hello everyone,
>
> On Android, different applications have varying tolerance for
> decompression latency. Applications with higher tolerance for
> decompression latency are better suited for algorithms like ZSTD,
> which provides high compression ratio but slower decompression
> speed. Conversely, applications with lower tolerance for
> decompression latency can use algorithms like LZ4 or LZO that
> offer faster decompression but lower compression ratios. For example,
> lightweight applications (with few anonymous pages) or applications
> without foreground UI typically have higher tolerance for decompression
> latency.
>
> Similarly, in memory allocation slow paths or under high CPU
> pressure, using algorithms with faster compression speeds might
> be more appropriate.
>
> This patch introduces a per-cgroup compression priority mechanism,
> where different compression priorities map to different algorithms.
> This allows administrators to select appropriate compression
> algorithms on a per-cgroup basis.
>
> Currently, this patch is experimental and we would greatly
> appreciate community feedback. I'm uncertain whether obtaining
> compression priority via get_cgroup_comp_priority in zram is the
> best approach. While this implementation is convenient, it seems
> somewhat unusual. Perhaps the next step should be to pass
> compression priority through page->private.
I agree with TJ's and Shakeel's take on this. You (or some other
zram/zswap users) will have to present a more compelling case for the
necessity of a hierarchical structure for this property :)
The semantics itself is unclear to me - what's the default? How should
inheritance be defined? What happens when cgroups are killed etc?
As a side note, seems like there is a proposal for swap device
priority (+ Youngjun)
https://lore.kernel.org/all/20250716202006.3640584-1-youngjun.park@lge.com/
Is this something you can leverage?
Another alternative is to make this zram-internal, i.e add knobs to
zram sysfs, or extend the recomp parameter. I'll defer to zram
maintainers and users to comment on this :)
Powered by blists - more mailing lists