On Mon, Jun 17, 2024 at 5:58 AM Chengming Zhou <chengming.zhou@xxxxxxxxx> wrote: > > Zswap uses 32 pools to workaround the locking scalability problem in > zsmalloc, which brings its own problems like memory waste and more > memory fragmentation. > > Testing results show that we can have near performance with only one > pool in zswap after changing zsmalloc to use per-size_class lock instead > of pool spinlock. > > Testing kernel build (make bzImage -j32) on tmpfs with memory.max=1GB, > and zswap shrinker enabled with 10GB swapfile on ext4. > > real user sys > 6.10.0-rc3 138.18 1241.38 1452.73 > 6.10.0-rc3-onepool 149.45 1240.45 1844.69 > 6.10.0-rc3-onepool-perclass 138.23 1242.37 1469.71 > > Signed-off-by: Chengming Zhou <chengming.zhou@xxxxxxxxx> Nice! I see minimal difference between one-pool-with-per-class lock and current version, and the memory fragmentation should be reduced. Anyway, I'll let the zsmalloc maintainers have the final say over their side, but if this patch is picked up (and with the assumption that the per-class lock is re-introduced), please feel free to include: Reviewed-by: Nhat Pham <nphamcs@xxxxxxxxx>