v10 2026-07-23

引入 cgroup 交换层级控制 · v10

引入“Swap Tiers”概念,允许用户将交换设备分组并指定cgroup层级,v2移除显式“+”选择,默认所有层级被选中。

原始补丁链接

子 Patch(6)

1/6
mm: swap: introduce swap tier infrastructure
This patch introduces the “Swap tier” concept, which serves as an abstraction layer for managing swap devices based on their performance characteristics (e.g., NVMe, HDD, Network swap). Swap tiers ar
2/6
mm: swap: associate swap devices with tiers
This patch connects swap devices to the swap tier infrastructure, ensuring that devices are correctly assigned to tiers based on their priority. A tier_mask is added to identify the tier membership
3/6
mm: memcontrol: add interface for swap tier selection
Introduce memory.swap.tiers.max, a flat-keyed file listing each tier defined in /sys/kernel/mm/swap/tiers with its state, “max” (allowed, the default) or “0” (disabled). A tier is one bit in the cgro
4/6
mm: swap: filter swap allocation by memcg tier mask
Apply memcg tier effective mask during swap slot allocation to enforce per-cgroup swap tier restrictions. The folio’s effective mask is computed once and passed to the fast, slow and discard paths as
5/6
selftests/mm: add a swap tier configuration test
This commit adds a test program for the global swap tier interface at /sys/kernel/mm/swap/tiers. It checks the add, split and remove operations and the documented error and batch atomicity rules. It a
6/6
selftests/cgroup: add a swap tier routing test
This commit adds a test program for the per-cgroup swap tier control memory.swap.tiers.max. It checks the default mask, toggling a tier, rejection of invalid input, and that recreating a tier resets t