Skip to content

RFC Introduce per-cgroup compression priority

jinji zhong cgroups drbd-dev linux-block linux-doc linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mm/memcontrol: Introduce per-cgroup compression priorityinclude/linux/memcontrol.h mm/memcontrol.c+50 -00 replies
2/3zram: Zram supports per-cgroup compression prioritydrivers/block/zram/zram_drv.c drivers/block/zram/zram_drv.h+68 -80 replies
3/3Doc: Update documentation for per-cgroup compression priorityDocumentation/admin-guide/blockdev/zram.rst Documentation/admin-guide/cgroup-v2.rst+21 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/3] Introduce per-cgroup compression priority

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.

jinji zhong (3):
mm/memcontrol: Introduce per-cgroup compression priority
zram: Zram supports per-cgroup compression priority
Doc: Update documentation for per-cgroup compression priority

 Documentation/admin-guide/blockdev/zram.rst | 18 +++--
 Documentation/admin-guide/cgroup-v2.rst     |  7 ++
 drivers/block/zram/zram_drv.c               | 74 ++++++++++++++++++---
 drivers/block/zram/zram_drv.h               |  2 +
 include/linux/memcontrol.h                  | 19 ++++++
 mm/memcontrol.c                             | 31 +++++++++
 6 files changed, 139 insertions(+), 12 deletions(-)
Signature · 1 line
2.48.1