v11
2026-09-27
按优先级的 swap 分层 · v11
swap tier RFC v11 把每个 swap 优先级视为独立 tier,tier 内轮转、tier 间按序,为 per-cgroup 设备选择铺路。
原始补丁链接
子 Patch(4)
1/4
mm: swap: introduce swap tier infrastructure
Introduce the “swap tier” as an abstraction over swap devices, so that swap allocation is organized on a tier basis rather than on a flat list of devices. Swap priority already points this way. Devic
2/4
mm: swap: allocate swap slots from swap tiers
The slow allocation path walks swap_avail_head, one plist of every available swap device, ordered by priority. Give each tier its own list of available devices instead. The slow path now walks the ti
3/4
mm: swap: add a debugfs interface for memcg tier selection
Swap tiers do nothing until something chooses between them. Let a memory cgroup do that. Each cgroup carries a mask of the tiers it may swap to. Write a cgroup path and a hex mask to /sys/kernel/debu
4/4
mm: swap: filter swap allocation by memcg tier mask
Apply the cgroup tier mask during swap slot allocation to enforce per-cgroup swap tier restrictions. The folio’s mask is looked up once and passed to the fast, slow and discard paths as a parameter,