From: Harry Yoo <harry@kernel.org>
To: Hao Li <hao.li@linux.dev>, vbabka@kernel.org, akpm@linux-foundation.org
Cc: cl@gentwo.org, rientjes@google.com, roman.gushchin@linux.dev,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] mm/slub: detach and reattach partial slabs in batch
Date: Mon, 1 Jun 2026 12:51:43 +0900 [thread overview]
Message-ID: <fca0e08d-a00c-442c-a0d6-447bbd5a585c@kernel.org> (raw)
In-Reply-To: <20260529035120.81304-3-hao.li@linux.dev>
[-- Attachment #1.1: Type: text/plain, Size: 1456 bytes --]
On 5/29/26 12:50 PM, Hao Li wrote:
> get_partial_node_bulk() moves each selected slab from the node's
> partial list to the local pc->slabs list using a remove_partial() and
> list_add() pair. In practice, the loop often detaches several adjacent
> slabs. Doing this individually repeatedly manipulates list pointers
> while holding n->list_lock, which causes unnecessary churn.
>
> To demonstrate this, the counts below show how often single vs. multiple
> consecutive slabs are retrieved during a will-it-scale mmap stress test:
>
> consecutive_slabs_count frequency
> = 1 277345324
> = 2 335238023
> = 3 175717884
>> = 4 88862337
>
> The data confirms that retrieving multiple contiguous slabs is highly
> frequent.
>
> To optimize this, track contiguous runs of matching slabs and move each
> run in a single operation using list_bulk_move_tail(). This reduces list
> pointer churn inside the lock critical section.
>
> Apply the same optimization to __refill_objects_node() when reattaching
> leftover partial slabs back to the node's partial list.
>
> The will-it-scale mmap benchmark shows a 2% ~ 5% performance improvement
> after applying this patch.
>
> Signed-off-by: Hao Li <hao.li@linux.dev>
> ---
Reviewed-by: Harry Yoo (Oracle) <harry@kernel.org>
--
Cheers,
Harry / Hyeonggon
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-06-01 3:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 3:50 [PATCH v3 0/2] mm/slub: batch partial slab list operations Hao Li
2026-05-29 3:50 ` [PATCH v3 1/2] mm/slub: introduce helpers for node partial slab state Hao Li
2026-06-01 3:38 ` Harry Yoo
2026-06-01 5:26 ` Hao Li
2026-06-01 6:17 ` Harry Yoo
2026-05-29 3:50 ` [PATCH v3 2/2] mm/slub: detach and reattach partial slabs in batch Hao Li
2026-06-01 3:51 ` Harry Yoo [this message]
2026-05-29 8:01 ` [PATCH v3 0/2] mm/slub: batch partial slab list operations Vlastimil Babka (SUSE)
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=fca0e08d-a00c-442c-a0d6-447bbd5a585c@kernel.org \
--to=harry@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=cl@gentwo.org \
--cc=hao.li@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=vbabka@kernel.org \
/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
Powered by JetHome