Re: [PATCH v5 2/4] mm/zsmalloc: drop pool->lock from zs_free on 64-bit systems
From: Nhat Pham
Date: Wed Jun 24 2026 - 18:39:30 EST
On Wed, Jun 24, 2026 at 2:57 PM Barry Song <baohua@xxxxxxxxxx> wrote:
>
> On Wed, Jun 24, 2026 at 2:15 PM Wenchao Hao <haowenchao22@xxxxxxxxx> wrote:
> >
> > This name reflects the two key things the function does:
> > 1. Resolves obj -> class (via class_idx or zspage, depending on arch)
> > 2. Acquires and holds class->lock on return
> >
> > The "to_class" part captures the lookup/resolution, and "and_lock"
> > makes the locking responsibility explicit.
>
> I think obj_to_class_and_lock() is not a good fit.
>
> The issue is that class is a noun, while lock is a verb, so the
> name mixes a transformation (obj_to_class) with an action
> (and_lock) in an inconsistent way. It reads asymmetrically.
>
> maybe just your original name if we can't find a better one:-)
>
> There are only two hard things in Computer Science: cache
> invalidation and naming things.
>
> Best Regards
> Barry
get_and_lock_obj_class()? :)
or obj_class_get_and_lock()? - there's swap_cluster_get_and_lock() as
the precedent.
Anyway naming is hard.