Re: [RFC PATCH] zram: support asynchronous GC for lazy slot freeing
From: Xueyuan Chen
Date: Tue Apr 14 2026 - 01:51:33 EST
On Sun, Apr 12, 2026 at 07:48:48PM +0800, Kairui Song wrote:
[...]
>What is making this slot_free so costly? zs_free?
Yes, I've captured some perf data on RK3588 cpu2:
- 3.79% 0.42% zram [zram] [k] slot_free
- 89.04% slot_free
- 65.40% zs_free
+ 77.29% free_zspage
+ 21.75% kmem_cache_free
0.68% __kern_my_cpu_offset
+ 13.19% _raw_spin_unlock
+ 4.86% _raw_read_unlock
4.75% obj_free
+ 4.72% _raw_read_lock
3.64% fix_fullness_group
+ 2.02% _raw_spin_lock
+ 1.31% kmem_cache_free
It's clear that zs_free is the primary hotspot, accounting for ~65.40%
of the total slot_free cycles. Beyond that, have some read and spin lock
in slot_free.
--
Thanks,
Xueyuan