Re: [PATCH v7 4/4] mm: swap: filter swap allocation by memcg tier mask
From: Nhat Pham
Date: Sat May 30 2026 - 14:21:45 EST
On Sat, May 30, 2026 at 10:51 AM Nhat Pham <nphamcs@xxxxxxxxx> wrote:
>
>
> How expensive is it to add per-cpu caching for each device :(
to clarify - a percpu_swap_cluster per si for every si.
>
... or for each tier (assuming devices in each tier share the same
performance characteristics, and could be used interchangeably?).
Basically:
struct percpu_swap_cluster {
struct swap_info_struct *si[MAX_SWAPTIER][SWAP_NR_ORDERS];
unsigned long offset[MAX_SWAPTIER][SWAP_NR_ORDERS];
local_lock_t lock;
};
Seems like 4 is the default number of tier right? So the extra
overhead is just (nr cpu) * 10 * 3 * (sizeof(unsigned long) +
sizeof(*ptr)) or wev?