On 2026-09-28 23:19, Matthias Goergens wrote:
Hi Matthias !
quoted
Just like we already have a "swappiness=" parameter in the reclaim
interface, perhaps adding a "swap.tier=" would be better and much
cleaner to achieve the same goal? Based on Youngjun's work here:
https://lore.kernel.org/all/20260916183437.2946306-1-youngjun.park@lge.com/ (local)
Thanks, I think that's the right base. I tried it: on top of
Youngjun's v11, a "swap.tier=" argument to memory.reclaim is about 40
lines. In a VM with zram at a higher priority than a disk swap
device, and a cgroup whose tier mask allowed only the disk, ordinary
reclaim in that cgroup stayed on the disk, while memory.reclaim with
"swap.tier=" pointing at zram went to zram only.
There is an earlier attempt that may be worth a look.
https://lore.kernel.org/all/20260618044857.69439-1-jiahao.kernel@gmail.com/ (local)
If you go this way, the discussion in that thread worth refering too.
What it doesn't cover yet is reclaim outside any configured cgroup:
under global pressure, a cgroup nobody configured still reached the
Right, so for now every cgroup has to be set to exclude zram, unless
another idea or more code covers it.
zram tier. So for v3 I'd like to add a system-wide limit on which
tiers pressure reclaim may use, on top of the per-cgroup settings.
I'll wait for Youngjun's v12 and build on that.
I have looked through the whole series, and I will keep this use case
in mind while working on v12. :)
Also, to share what I had in mind, I was planning a sysfs interface
for each swap tier, /sys/kernel/mm/swap/tiers/<tier name> (exact
naming TBD). Maybe the system-wide limit could be handled there as one
of its use cases?
Let's discuss it in more detail after v12.
Thanks,
Youngjun