From: Hao Li <hao.li@linux.dev>
To: Harry Yoo <harry.yoo@oracle.com>
Cc: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>,
Ming Lei <ming.lei@redhat.com>, Vlastimil Babka <vbabka@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linux-block@vger.kernel.org,
Christoph Hellwig <hch@infradead.org>
Subject: Re: [Regression] mm:slab/sheaves: severe performance regression in cross-CPU slab allocation
Date: Fri, 6 Mar 2026 16:32:17 +0800 [thread overview]
Message-ID: <mhyjdgxppdu6bfnt2ksyltj5hqcn53ztbh4bmnwctt6phxzucb@x4qcnhjs2c2x> (raw)
In-Reply-To: <aapeVb_L5zohWRRe@hyeyoo>
On Fri, Mar 06, 2026 at 01:55:49PM +0900, Harry Yoo wrote:
> On Thu, Feb 26, 2026 at 07:02:11PM +0100, Vlastimil Babka (SUSE) wrote:
> > On 2/25/26 10:31, Ming Lei wrote:
> > > Hi Vlastimil,
> > >
> > > On Wed, Feb 25, 2026 at 09:45:03AM +0100, Vlastimil Babka (SUSE) wrote:
> > >> On 2/24/26 21:27, Vlastimil Babka wrote:
> > >> >
> > >> > It made sense to me not to refill sheaves when we can't reclaim, but I
> > >> > didn't anticipate this interaction with mempools. We could change them
> > >> > but there might be others using a similar pattern. Maybe it would be for
> > >> > the best to just drop that heuristic from __pcs_replace_empty_main()
> > >> > (but carefully as some deadlock avoidance depends on it, we might need
> > >> > to e.g. replace it with gfpflags_allow_spinning()). I'll send a patch
> > >> > tomorrow to test this theory, unless someone beats me to it (feel free to).
> > >> Could you try this then, please? Thanks!
> > >
> > > Thanks for working on this issue!
> > >
> > > Unfortunately the patch doesn't make a difference on IOPS in the perf test,
> > > follows the collected perf profile on linus tree(basically 7.0-rc1 with your patch):
> >
> > what about this patch in addition to the previous one? Thanks.
> >
> > ----8<----
> > From d3e8118c078996d1372a9f89285179d93971fdb2 Mon Sep 17 00:00:00 2001
> > From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
> > Date: Thu, 26 Feb 2026 18:59:56 +0100
> > Subject: [PATCH] mm/slab: put barn on every online node
> >
> > Including memoryless nodes.
> >
> > Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
> > ---
>
> Just taking a quick grasp...
>
> > @@ -6121,7 +6122,8 @@ void slab_free(struct kmem_cache *s, struct slab *slab, void *object,
> > if (unlikely(!slab_free_hook(s, object, slab_want_init_on_free(s), false)))
> > return;
> >
> > - if (likely(!IS_ENABLED(CONFIG_NUMA) || slab_nid(slab) == numa_mem_id())
> > + if (likely(!IS_ENABLED(CONFIG_NUMA) || (slab_nid(slab) == numa_mem_id())
> > + || !node_isset(slab_nid(slab), slab_nodes))
>
> I think you intended !node_isset(numa_mem_id(), slab_nodes)?
This is a good catch! and it could explain why CPUs on memoryless nodes can have
higher barn_get_fail. They have too less sheaves in barn...
>
> "Skip freeing to pcs if it's remote free, but memoryless nodes is
> an exception".
>
> > && likely(!slab_test_pfmemalloc(slab))) {
> > if (likely(free_to_pcs(s, object, true)))
> > return;
>
> --
> Cheers,
> Harry / Hyeonggon
next prev parent reply other threads:[~2026-03-06 8:32 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-24 2:52 Ming Lei
2026-02-24 5:00 ` Harry Yoo
2026-02-24 9:07 ` Ming Lei
2026-02-25 5:32 ` Hao Li
2026-02-25 6:54 ` Harry Yoo
2026-02-25 7:06 ` Hao Li
2026-02-25 7:19 ` Harry Yoo
2026-02-25 8:19 ` Hao Li
2026-02-25 8:41 ` Harry Yoo
2026-02-25 8:54 ` Hao Li
2026-02-25 8:21 ` Harry Yoo
2026-02-24 6:51 ` Hao Li
2026-02-24 7:10 ` Harry Yoo
2026-02-24 7:41 ` Hao Li
2026-02-24 20:27 ` Vlastimil Babka
2026-02-25 5:24 ` Harry Yoo
2026-02-25 8:45 ` Vlastimil Babka (SUSE)
2026-02-25 9:31 ` Ming Lei
2026-02-25 11:29 ` Vlastimil Babka (SUSE)
2026-02-25 12:24 ` Ming Lei
2026-02-25 13:22 ` Vlastimil Babka (SUSE)
2026-02-26 18:02 ` Vlastimil Babka (SUSE)
2026-02-27 9:23 ` Ming Lei
2026-03-05 13:05 ` Vlastimil Babka (SUSE)
2026-03-05 15:48 ` Ming Lei
2026-03-06 1:01 ` Ming Lei
2026-03-06 4:17 ` Hao Li
2026-03-06 4:55 ` Harry Yoo
2026-03-06 8:32 ` Hao Li [this message]
2026-03-06 8:47 ` Vlastimil Babka (SUSE)
2026-03-06 10:22 ` Ming Lei
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=mhyjdgxppdu6bfnt2ksyltj5hqcn53ztbh4bmnwctt6phxzucb@x4qcnhjs2c2x \
--to=hao.li@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=harry.yoo@oracle.com \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ming.lei@redhat.com \
--cc=vbabka@kernel.org \
--cc=vbabka@suse.cz \
/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