[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <792c6837-137b-4667-8c4e-fdc988ae8878@suse.cz>
Date: Thu, 22 Jan 2026 10:30:44 +0100
From: Vlastimil Babka <vbabka@...e.cz>
To: Hao Li <hao.li@...ux.dev>
Cc: Harry Yoo <harry.yoo@...cle.com>, Petr Tesarik <ptesarik@...e.com>,
Christoph Lameter <cl@...two.org>, David Rientjes <rientjes@...gle.com>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Andrew Morton <akpm@...ux-foundation.org>,
Uladzislau Rezki <urezki@...il.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>,
Suren Baghdasaryan <surenb@...gle.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Alexei Starovoitov <ast@...nel.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, linux-rt-devel@...ts.linux.dev,
bpf@...r.kernel.org, kasan-dev@...glegroups.com
Subject: Re: [PATCH v3 21/21] mm/slub: cleanup and repurpose some stat items
On 1/22/26 06:52, Hao Li wrote:
> On Fri, Jan 16, 2026 at 03:40:41PM +0100, Vlastimil Babka wrote:
>> A number of stat items related to cpu slabs became unused, remove them.
>>
>> Two of those were ALLOC_FASTPATH and FREE_FASTPATH. But instead of
>> removing those, use them instead of ALLOC_PCS and FREE_PCS, since
>> sheaves are the new (and only) fastpaths, Remove the recently added
>> _PCS variants instead.
>>
>> Change where FREE_SLOWPATH is counted so that it only counts freeing of
>> objects by slab users that (for whatever reason) do not go to a percpu
>> sheaf, and not all (including internal) callers of __slab_free(). Thus
>> flushing sheaves (counted by SHEAF_FLUSH) no longer also increments
>> FREE_SLOWPATH. This matches how ALLOC_SLOWPATH doesn't count sheaf
>> refills (counted by SHEAF_REFILL).
>>
>> Reviewed-by: Suren Baghdasaryan <surenb@...gle.com>
>> Signed-off-by: Vlastimil Babka <vbabka@...e.cz>
>> ---
>> mm/slub.c | 77 +++++++++++++++++----------------------------------------------
>> 1 file changed, 21 insertions(+), 56 deletions(-)
>>
>> diff --git a/mm/slub.c b/mm/slub.c
>> index c12e90cb2fca..d73ad44fa046 100644
>> --- a/mm/slub.c
>> +++ b/mm/slub.c
>> @@ -330,33 +330,19 @@ enum add_mode {
>> };
>>
>> enum stat_item {
>> - ALLOC_PCS, /* Allocation from percpu sheaf */
>> - ALLOC_FASTPATH, /* Allocation from cpu slab */
>> - ALLOC_SLOWPATH, /* Allocation by getting a new cpu slab */
>> - FREE_PCS, /* Free to percpu sheaf */
>> + ALLOC_FASTPATH, /* Allocation from percpu sheaves */
>> + ALLOC_SLOWPATH, /* Allocation from partial or new slab */
>> FREE_RCU_SHEAF, /* Free to rcu_free sheaf */
>> FREE_RCU_SHEAF_FAIL, /* Failed to free to a rcu_free sheaf */
>> - FREE_FASTPATH, /* Free to cpu slab */
>> - FREE_SLOWPATH, /* Freeing not to cpu slab */
>> + FREE_FASTPATH, /* Free to percpu sheaves */
>> + FREE_SLOWPATH, /* Free to a slab */
>
> Nits: Would it make sense to add stat(s, FREE_SLOWPATH) in
> free_deferred_objects() as well, since it also calls __slab_free()?
Yeah.
> Everything else looks good.
>
> This patchset replaces cpu slab with cpu sheaves and really simplifies the code
> overall - I really like the direction and the end result. It's really been a
> pleasure reviewing this series. Thanks!
>
> Reviewed-by: Hao Li <hao.li@...ux.dev>
Thanks a lot for the thorough review!
Powered by blists - more mailing lists