[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <k6jwua5rlkds7dxomwvxotwtjq4hauyevvyoxd5hjz733k7kk5@mmezlradxhpu>
Date: Mon, 27 Oct 2025 10:29:06 -0700
From: Shakeel Butt <shakeel.butt@...ux.dev>
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,
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
Subject: Re: [RFC PATCH 0/3] Introduce per-cgroup compression priority
Hi Jinji,
On Sun, Oct 26, 2025 at 01:05:07AM +0000, jinji zhong 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.
>
Setting aside the issues in the implementation (like changing
compression algorithm of a cgroup while it already has some memory
compressed using older algo), I don't think memcg interface is the right
way to go about it. We usually add interfaces to memcg that have
hierarchical semantics.
Anyways if you want to have this feature, I think BPF might be the way
to get this flexibility without introducing any stable API and then you
can experiment and evaluate if this really helps.
Powered by blists - more mailing lists