Re: [PATCH v3 18/21] slab: update overview comments

Vlastimil Babka
2026-01-22T08:49:16Z

On 1/22/26 07:41, Harry Yoo wrote:
> On Fri, Jan 16, 2026 at 03:40:38PM +0100, Vlastimil Babka wrote:
>> The changes related to sheaves made the description of locking and other
>> details outdated. Update it to reflect current state.
>>
>> Also add a new copyright line due to major changes.
>>
>> Reviewed-by: Suren Baghdasaryan <surenb@google.com>
>> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
>> ---
>> @@ -112,47 +123,46 @@
>> + * node->barn->lock (spinlock)
>> *
>> - * lockless fastpaths
>> + * Lockless freeing
>> + *
>> + * Objects may have to be freed to their slabs when they are from a remote
>> + * node (where we want to avoid filling local sheaves with remote objects)
>> + * or when there are too many full sheaves. On architectures supporting
>> + * cmpxchg_double this is done by a lockless update of slab's freelist and
>> + * counters, otherwise slab_lock is taken. This only needs to take the
>> + * list_lock if it's a first free to a full slab, or when there are too many
>> + * fully free slabs and some need to be discarded.
>
> nit: "or when a slab becomes empty after the free"?
> because we don't check nr_partial before acquiring list_lock.
>
> With that addressed,
> Reviewed-by: Harry Yoo <harry.yoo@oracle.com>

Good point, thanks!