[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251030113228.18817-1-zhongjinji@honor.com>
Date: Thu, 30 Oct 2025 19:32:28 +0800
From: zhongjinji <zhongjinji@...or.com>
To: <shakeel.butt@...ux.dev>
CC: <akpm@...ux-foundation.org>, <axboe@...nel.dk>, <cgroups@...r.kernel.org>,
	<christoph.boehmwalder@...bit.com>, <corbet@....net>,
	<drbd-dev@...ts.linbit.com>, <dsterba@...e.com>, <feng.han@...or.com>,
	<hannes@...xchg.org>, <jinji.z.zhong@...il.com>, <lars.ellenberg@...bit.com>,
	<linux-block@...r.kernel.org>, <linux-doc@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>, <liulu.liu@...or.com>,
	<mhocko@...nel.org>, <minchan@...nel.org>, <mkoutny@...e.com>,
	<muchun.song@...ux.dev>, <philipp.reisner@...bit.com>,
	<roman.gushchin@...ux.dev>, <senozhatsky@...omium.org>, <terrelln@...com>,
	<tj@...nel.org>, <zhongjinji@...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
Zram uses flags to track the compression priority of each page,
which should be ok when the page is decompressed.
> 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.
Thanks a lot, Shakeel. I got it.
> 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
 
