mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
To: Hao Li <hao.li@linux.dev>
Cc: harry@kernel.org, akpm@linux-foundation.org, cl@gentwo.org,
	rientjes@google.com, roman.gushchin@linux.dev,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Pedro Falcato <pfalcato@suse.de>
Subject: Re: [RFC PATCH 0/2] mm/slub: reduce list_lock contention with slab parking
Date: Tue, 15 Sep 2026 09:10:22 +0200	[thread overview]
Message-ID: <4d9ebf64-e3b4-4b6c-9576-e8be59193f80@kernel.org> (raw)
In-Reply-To: <aqPg5YRKdaZiBj9b@fedora>

On 9/11/26 13:24, Hao Li wrote:
> On Mon, Sep 07, 2026 at 03:44:08PM +0200, Vlastimil Babka (SUSE) wrote:
>> On 8/24/26 14:19, Hao Li wrote:
>> > 
>> > Detailed data
>> > -------------
>> > 
>> > metric                              before             after             delta      change
>> > ==========================================================================================
>> > alloc_fastpath                     155,417           168,534            13,117      +8.44%
>> > alloc_slab                      55,679,646        26,702,510       -28,977,136     -52.04%
>> 
>> It's interesting that this is reduced so much. Is it because parked slabs
>> cause more slabs to stay around for reuse, despite they are unparked
>> immediately when trying to allocate/refill? That seems odd?
> 
> Yeah, it does look counter-intuitive at first glance. My understanding is that
> the parking mechanism helps by bypassing the partial list spinlock, allowing
> partial slabs to be parked onto the llist locklessly at any point. Because of
> this, the refill path gets to see and reuse more partial slabs instead of
> having to allocate fresh ones so frequently.

Hmm that's an interesting effect, surprisingly large if true. Because the
slabs we'd be parking are transitioning from full, there would be most often
just a single free object to reuse?

>> 
>> > alloc_slowpath                           0                 0                 0      +0.00%
>> > barn_get                             2,715             2,771                56      +2.06%
>> > barn_get_fail                            2                 0                -2    -100.00%
>> > barn_put                             2,715             2,770                55      +2.03%
>> > barn_put_fail                1,370,488,457     1,668,257,974       297,769,517     +21.73%
>> > cmpxchg_double_fail              3,827,935           549,427        -3,278,508     -85.65%
>> > free_add_partial             1,684,340,964     2,161,921,625       477,580,661     +28.35%
>> > free_fastpath                       31,766            32,979             1,213      +3.82%
>> > free_rcu_sheaf              43,855,689,417    53,384,314,553     9,528,625,136     +21.73%
>> 
>> This metric (and others with similar numbers) should not be affected by the
>> change. Does it mean the benchmark has a fixed time to run, but manages to
>> do more work in that time thanks to the increased throughput?
> 
> Exactly! In fact, the increase in free_rcu_sheaf matches the throughput gain
> almost 1:1. A ~21% increase in throughput naturally translates to ~21% more object
> allocations and frees.

Ack!


  reply	other threads:[~2026-09-15  7:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24 12:19 Hao Li
2026-08-24 12:25 ` [RFC PATCH 1/2] mm/slub: make the case handling in __slab_free() easier to follow Hao Li
2026-08-24 12:25   ` [RFC PATCH 2/2] mm/slub: introduce slab parking to reduce list_lock contention Hao Li
2026-09-07 13:38     ` Vlastimil Babka (SUSE)
2026-09-07 16:19       ` Pedro Falcato
2026-09-11 13:06       ` Hao Li
2026-09-15  7:43         ` Vlastimil Babka (SUSE)
2026-09-16  3:05           ` Hao Li
2026-09-16  8:01         ` Vlastimil Babka (SUSE)
2026-09-17  9:13           ` Hao Li
2026-09-16 13:50         ` Harry Yoo
2026-09-17  9:42           ` Hao Li
2026-09-04 16:04   ` [RFC PATCH 1/2] mm/slub: make the case handling in __slab_free() easier to follow Vlastimil Babka (SUSE)
2026-09-07  2:55     ` Hao Li
2026-09-14 13:39   ` Harry Yoo
2026-09-16 14:00     ` Hao Li
2026-08-27 16:24 ` [RFC PATCH 0/2] mm/slub: reduce list_lock contention with slab parking Pedro Falcato
2026-08-30 14:59   ` Hao Li
2026-09-07 13:44 ` Vlastimil Babka (SUSE)
2026-09-11 11:24   ` Hao Li
2026-09-15  7:10     ` Vlastimil Babka (SUSE) [this message]
2026-09-16 12:58       ` Hao Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4d9ebf64-e3b4-4b6c-9576-e8be59193f80@kernel.org \
    --to=vbabka@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=hao.li@linux.dev \
    --cc=harry@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pfalcato@suse.de \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®