zswap: accounting & cgroup control
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest6 patches 17 repliesIn review 4 of 6 applied
- v15 patches 28 repliesSuperseded
Patches in v2 4 of 6 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | Documentation: filesystems: proc: update meminfo sectionDocumentation/ | +99 | 3 replies | |
| 2/6 | mm: Kconfig: move swap and slab config options to the MM sectioninit/ mm/ | +123 | 0 replies | Applied |
| 3/6 | mm: Kconfig: group swap, slab, hotplug and thp options into submenusmm/ | +221 | 3 replies | |
| 4/6 | mm: Kconfig: simplify zswap configurationdrivers/ mm/ | +27 | 0 replies | Applied |
| 5/6 | mm: zswap: add basic meminfo and vmstat coverageDocumentation/ fs/ include/ +3 more | +32 | 1 reply | Applied |
| 6/6 | zswap: memcg accountingDocumentation/ include/ mm/ +1 more | +293 | 10 replies | Applied |
Reviews trailers per patch
2 of 6 patches have a Reviewed-by or Acked-by.
| Patch | David Hildenbrand | Johannes Weiner |
|---|---|---|
| 1/6 | A-b | |
| 2/6 | ||
| 3/6 | ||
| 4/6 | ||
| 5/6 | A-b | |
| 6/6 | Signed-of-by |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/6] zswap: accounting & cgroup control
Changelog
- Refresh and update meminfo documentation (Andrew)
- Discussions around stat sharing opportunities with zram. But agreed that zswap is a cache and zram a backend that could theoretically be stacked, so they need to be understandable separately. (Minchan)
Overview
Zswap can consume nearly a quarter of RAM in the default configuration, yet it's neither listed in /proc/meminfo, nor is it accounted and manageable on a per-cgroup basis.
This makes reasoning about the memory situation on a host in general rather difficult. On shared/cgrouped hosts, the consequences are worse. First, workloads can escape memory containment and cause resource priority inversions: a lo-pri group can fill the global zswap pool and force a hi-pri group out to disk. Second, not all workloads benefit from zswap 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 the missing global accounting as well as cgroup tracking & control for zswap backing memory:
- Patch 1 refreshes the very out-of-date meminfo documentation in Documentation/filesystems/proc.rst.
- Patches 2-4 clean up related and adjacent options in Kconfig. Not actual dependencies, just things I noticed during development.
- Patch 5 adds meminfo and vmstat coverage for zswap consumption and activity.
- Patch 6 implements per-cgroup tracking & control of zswap memory.
Based on v5.18-rc4-mmots-2022-04-26-19-34-5-g5e1fdb02de7a.
Documentation/admin-guide/cgroup-v2.rst | 21 ++ Documentation/filesystems/proc.rst | 161 +++++---- 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 ++- 12 files changed, 753 insertions(+), 398 deletions(-)