Re: [PATCH v3 1/2] mm/slub: introduce helpers for node partial slab state
From: Hao Li
Date: Mon Jun 01 2026 - 01:30:59 EST
On Mon, Jun 01, 2026 at 12:38:48PM +0900, Harry Yoo wrote:
>
>
> On 5/29/26 12:50 PM, Hao Li wrote:
> > Wrap partial slab count inc/dec and flag set/clear into
> > helper functions to reduce code duplication.
> >
> > Note that __add_partial() is called locklessly in
> > early_kmem_cache_node_alloc(), but since there is no such use case for
> > removal, __remove_partial() does not exist.
>
> nit: __remove_partial() -> clear_partial_node_state()
Ah, in this sentence, I just wanted to clarify that __remove_partial doesn't
exist. it's not a typo :)
> oh wait, it does exist. Let's drop this paragraph?
This paragraph is just a quick side note to explain why __remove_partial()
doesn't exist. I noticed that __add_partial lacks a symmetric counterpart,
which felt a bit abrupt/inconsistent, so I wanted to share some context on why
that is.
Historically, the __remove_partial function did exist. Back then, we had a use
case where free_partial called __remove_partial without holding the lock.
Later, free_partial was changed to call remove_partial under the lock, which is
why __remove_partial was eventually removed in commit
52b4b950b50740bff507a62907e86710743c22e7.
>
> Otherwise LGTM!
> Reviewed-by: Harry Yoo (Oracle) <harry@xxxxxxxxxx>
Thanks!
>
> > Suggested-by: Harry Yoo <harry@xxxxxxxxxx>
> > Signed-off-by: Hao Li <hao.li@xxxxxxxxx>
>
--
Thanks,
Hao