Re: [PATCH v6 0/4] mm/zsmalloc: reduce lock contention in zs_free()
From: Sergey Senozhatsky
Date: Tue Jul 07 2026 - 03:24:29 EST
On (26/06/26 09:49), Wenchao Hao wrote:
[..]
> Changes since v5:
> - 2/4: rename obj_handle_class_lock() to obj_class_get_and_lock().
> - Pick up Reviewed-by from Barry Song on 2/4, 3/4, 4/4.
>
> Changes since v4:
> - 1/4: rename macros to make their intent clearer, following the
> kernel's *_BITS convention (Nhat Pham, Barry Song).
> - 3/4: drop the unused pool argument from __free_zspage_lockless().
>
> Changes since v3:
> - 1/4: gate ZS_OBJ_CLASS_BITS on a new spare-bit check so unsuitable
> configs (e.g. UML, no sparsemem) fall back to plain obj layout
> instead of breaking the build. (sashiko AI review)
> - 2/4: annotate handle_to_obj()/record_obj() with READ_ONCE/WRITE_ONCE
> to silence KCSAN; sync the #if predicate with patch 1. (sashiko AI review)
> - 4/4: clarify when async_free_zspage() runs; pick up Reviewed-by. (Nhat Pham)
> - Drop Reviewed-by from Nhat Pham on 1/4 and 2/4: substantial logic
> changes since v3, please re-review.
>
> Changes since v2:
> - 3/4: drop likely() hint and tidy up else-branch braces, per review
> nits from Nhat Pham and Joshua Hahn.
> - 4/4 (new): document free_zspage helper variants in a single comment
> block, per Nhat Pham.
> - Pick up Reviewed-by tags from Nhat Pham (1/4, 2/4, 3/4) and
> Joshua Hahn (3/4).
> - Fix patch 1/4 and 2/4 From: to match Signed-off-by, per Barry Song.
>
> Changes since v1:
> - Rename obj-encoding macros for clarity.
> - Make 32-bit / 64-bit handling transparent at call sites
> (no #ifdef in callers).
> - Extract a helper to keep zs_free() unified.
>
> Wenchao Hao (3):
> mm/zsmalloc: encode class index in obj value for lockless class lookup
> mm/zsmalloc: drop pool->lock from zs_free on 64-bit systems
> mm/zsmalloc: document free_zspage helper variants
>
> Xueyuan Chen (1):
> mm/zsmalloc: drop class lock before freeing zspage
Folks, really sorry for not being around and not being helpful,
I'm catching up on emails and will look at this in the coming days.
Many, many thanks to everyone who worked on it, reviewed it,
contributed to this work in one way or another. Thank you!