Re: [PATCH v6 2/4] mm: swap: associate swap devices with tiers

From: Baoquan He

Date: Mon May 25 2026 - 19:06:24 EST


On 04/21/26 at 02:53pm, Youngjun Park wrote:
> 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 of swap devices.
> Although tier-based allocation logic is not yet implemented, this
> mapping is necessary to track which tier a device belongs to. Upon
> activation, the device is assigned to a tier by matching its priority
> against the configured tier ranges.
>
> The infrastructure allows dynamic modification of tiers, such as
> splitting or merging ranges. These operations are permitted provided
> that the tier assignment of already configured swap devices remains
> unchanged.
>
> This patch also adds the documentation for the swap tier feature,
> covering the core concepts, sysfs interface usage, and configuration
> details.
>
> Signed-off-by: Youngjun Park <youngjun.park@xxxxxxx>
> ---
> Documentation/mm/index.rst | 1 +
> Documentation/mm/swap-tier.rst | 159 +++++++++++++++++++++++++++++++++
> MAINTAINERS | 1 +
> include/linux/swap.h | 1 +
> mm/swap_state.c | 2 +-
> mm/swap_tier.c | 101 ++++++++++++++++++---
> mm/swap_tier.h | 13 ++-
> mm/swapfile.c | 2 +
> 8 files changed, 266 insertions(+), 14 deletions(-)
> create mode 100644 Documentation/mm/swap-tier.rst

LGTM,

Reviewed-by: Baoquan He <baoquan.he@xxxxxxxxx>