Re: [PATCH v3 2/2] mm, slab: simplify returning slab in __refill_objects_node()

From: Hao Li

Date: Mon May 25 2026 - 07:52:05 EST


On Mon, May 25, 2026 at 09:15:49AM +0200, Vlastimil Babka (SUSE) wrote:
> On 5/25/26 08:47, Hao Li wrote:
> > On Fri, May 22, 2026 at 04:23:21PM +0200, Vlastimil Babka (SUSE) wrote:
> >> When we return slabs to the partial list because we didn't fully refill
> >> from them, we observe the min_partial limit when the returned slab is
> >> empty, and discard it when over the limit. But it's unlikely for the
> >> limit to be reached while we were refilling, and the worst outcome is to
> >> have temporarily more free slabs on the list than necessary.
> >
> > Just wondering if the empty slabs temporarily exceed the limit and then some
> > objects get allocated from them, would this lead to more fragmented slabs in
> > the node partial list?
>
> I think since we're adding the slabs to tail and refill from head, it
> shouldn't happen that easily.

This makes sense!

> Fragmenting is possible in general due to bad
> luck, I doubt this change could make it noticeably worse.

I ran a test and even though the data is pretty noisy, the
length of the partial list indeed didn't really grow much.

And after applying both patches, I can see some improvement (1~2%) in overall
performance!

Reviewed-by: Hao Li <hao.li@xxxxxxxxx>
Tested-by: Hao Li <hao.li@xxxxxxxxx>

--
Thanks,
Hao