aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mm/util.c
diff options
context:
space:
mode:
authorChengming Zhou <zhouchengming@bytedance.com>2024-02-16 08:55:05 +0000
committerAndrew Morton <akpm@linux-foundation.org>2024-03-04 17:01:13 -0800
commit94ace3fec8477f8a46d08fc57cd1dd5efbd0a32b (patch)
treeac179b460545096cbd441a2c165260f6ed5d83c5 /mm/util.c
parentmm/zswap: global lru and shrinker shared by all zswap_pools (diff)
downloadwireguard-linux-94ace3fec8477f8a46d08fc57cd1dd5efbd0a32b.tar.xz
wireguard-linux-94ace3fec8477f8a46d08fc57cd1dd5efbd0a32b.zip
mm/zswap: change zswap_pool kref to percpu_ref
All zswap entries will take a reference of zswap_pool when zswap_store(), and drop it when free. Change it to use the percpu_ref is better for scalability performance. Although percpu_ref use a bit more memory which should be ok for our use case, since we almost have only one zswap_pool to be using. The performance gain is for zswap_store/load hotpath. Testing kernel build (32 threads) in tmpfs with memory.max=2GB. (zswap shrinker and writeback enabled with one 50GB swapfile, on a 128 CPUs x86-64 machine, below is the average of 5 runs) mm-unstable zswap-global-lru real 63.20 63.12 user 1061.75 1062.95 sys 268.74 264.44 [chengming.zhou@linux.dev: fix zswap_pools_lock usages after changing to percpu_ref] Link: https://lkml.kernel.org/r/20240228154954.3028626-1-chengming.zhou@linux.dev Link: https://lkml.kernel.org/r/20240210-zswap-global-lru-v3-2-200495333595@bytedance.com Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com> Reviewed-by: Nhat Pham <nphamcs@gmail.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Yosry Ahmed <yosryahmed@google.com> Cc: Chengming Zhou <chengming.zhou@linux.dev> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/util.c')
0 files changed, 0 insertions, 0 deletions