[PATCH 0/5] zswap: cgroup accounting & control

Johannes Weiner
2022-04-27T16:00:11Z

Zswap backing memory is currently not tracked (and limited) on a
per-cgroup basis. As a result, workloads can escape their memory
containment and cause resource priority inversions on a shared host.
E.g. a lo-pri group fills the global zswap pool and forces a hi-pri
group out to disk.

Also, zswap doesn't benefit all workloads equally. Some even suffer
when memory contents compress poorly, and are better off going to disk
swap directly. On a host with mixed workloads, it's currently not
possible to enable zswap for one workload but not for the other.

This series implements missing cgroup awareness and control for zswap
to address both issues.

More details on interface and implementation in patch 5.

Patches 1-3 clean up related and adjacent options in Kconfig. Not
dependencies, just things I noticed during development.

Based on v5.18-rc4-mmots-2022-04-26-19-34-5-g5e1fdb02de7a.

Documentation/admin-guide/cgroup-v2.rst | 21 ++
drivers/block/zram/Kconfig | 3 +-
fs/proc/meminfo.c | 7 +
include/linux/memcontrol.h | 54 +++
include/linux/swap.h | 5 +
include/linux/vm_event_item.h | 4 +
init/Kconfig | 123 -------
mm/Kconfig | 523 +++++++++++++++++++-----------
mm/memcontrol.c | 196 ++++++++++-
mm/vmstat.c | 4 +
mm/zswap.c | 50 ++-
11 files changed, 648 insertions(+), 342 deletions(-)