Re: [PATCH v2] zram: keep the hot statistics per CPU
From: Sergey Senozhatsky
Date: Sun Dec 06 2026 - 00:35:56 EST
On (26/12/06 14:29), Sergey Senozhatsky wrote:
> When several processes free swapped out memory at the same time, e.g. on
> munmap() or exit, all CPUs update pages_stored, compr_data_size,
> same_pages, huge_pages, huge_pages_since and notify_free stats, so the
> cachelines bounce a lot [1]. Keep the six counters per CPU instead, as
> s64 + u64_stats_sync updated with preemption disabled.
>
> munmap() test:
> before after
> 4 x 256 MiB 18.69 ms 14.12 ms (-24%)
> 8 x 128 MiB 14.82 ms 10.09 ms (-32%)
>
> Link: https://patch.msgid.link/20261123054746.2579253-3-senozhatsky@xxxxxxxxxxxx
> Link: https://lore.kernel.org/20261017031542.3504947-1-hongfengchen@xxxxxxxxxx [1]
> Signed-off-by: Hongfeng Chen <hongfengchen@xxxxxxxxxx>
> Signed-off-by: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>
> Co-developed-by: Hongfeng Chen <hongfengchen@xxxxxxxxxx>
Andrew, can you please replace 25-new.git/tree/patches/zram-keep-the-hot-statistics-per-cpu.patch
with this patch?