From: Harry Yoo <harry@kernel.org>
To: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Cc: Hao Li <hao.li@linux.dev>, Christoph Lameter <cl@gentwo.org>,
David Rientjes <rientjes@google.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
hu.shengming@zte.com.cn,
Vinicius Costa Gomes <vinicius.gomes@intel.com>
Subject: Re: [PATCH v3 1/2] mm, slab: add an optimistic __slab_try_return_freelist()
Date: Thu, 28 May 2026 17:15:33 +0900 [thread overview]
Message-ID: <98aadcdf-6062-4aea-9b33-e64b4b613618@kernel.org> (raw)
In-Reply-To: <20260522-b4-refill-optimistic-return-v3-1-2ba78ec1c6ed@kernel.org>
On 5/22/26 11:23 PM, Vlastimil Babka (SUSE) wrote:
> When we end up returning extraneous objects during refill to a slab
> where we just did a get_freelist_nofreeze(), it is likely no other CPU
> has freed objects to it meanwhile. We can then reattach the remainder of
> the freelist without having to walk the (potentially cache cold)
> freelist for finding its tail to connect slab->freelist to it.
>
> Add a __slab_try_return_freelist() function that does that. As suggested
> by Hao Li, it doesn't need to also return the slab to the partial list,
> because there's code in __refill_objects_node() that already does that
> for any slabs where we don't detach the freelist in the first place. So
> we just put the slab back to the pc.slabs list. It's no longer likely
> that the list will be empty now, so remove the unlikely() annotation.
>
> However, also change that code to add to the tail of the partial list
> instead of head to match what __slab_free() did and avoid a regression,
> that was reported for the earlier version by the kernel test robot [1].
> This change will also affect slabs which were grabbed from the partial
> list and not refilled from even partially, but those should be much more
> rare than a partial refill.
>
> [1]https://lore.kernel.org/all/202605112204.9382cecf-lkp@intel.com/
>
> Reviewed-by: Hao Li<hao.li@linux.dev>
> Signed-off-by: Vlastimil Babka (SUSE)<vbabka@kernel.org>
> ---
Reviewed-by: Harry Yoo (Oracle) <harry@kernel.org>
--
Cheers,
Harry / Hyeonggon
next prev parent reply other threads:[~2026-05-28 8:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-22 14:23 [PATCH v3 0/2] mm, slab: optimize returning objects after a partial refill Vlastimil Babka (SUSE)
2026-05-22 14:23 ` [PATCH v3 1/2] mm, slab: add an optimistic __slab_try_return_freelist() Vlastimil Babka (SUSE)
2026-05-22 17:40 ` Vlastimil Babka (SUSE)
2026-05-28 8:15 ` Harry Yoo [this message]
2026-05-22 14:23 ` [PATCH v3 2/2] mm, slab: simplify returning slab in __refill_objects_node() Vlastimil Babka (SUSE)
2026-05-25 6:47 ` Hao Li
2026-05-25 7:15 ` Vlastimil Babka (SUSE)
2026-05-25 11:51 ` Hao Li
2026-05-28 8:20 ` Harry Yoo
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=98aadcdf-6062-4aea-9b33-e64b4b613618@kernel.org \
--to=harry@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=cl@gentwo.org \
--cc=hao.li@linux.dev \
--cc=hu.shengming@zte.com.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=vbabka@kernel.org \
--cc=vinicius.gomes@intel.com \
/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