mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qing Wang <wangqing7171@gmail.com>
To: harry@kernel.org
Cc: akpm@linux-foundation.org, cl@gentwo.org, hao.li@linux.dev,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	rientjes@google.com, roman.gushchin@linux.dev, vbabka@kernel.org,
	wangqing7171@gmail.com
Subject: Re: [PATCH] mm/slab: only require the requested size when refilling
Date: Mon, 26 Oct 2026 17:29:57 +0800	[thread overview]
Message-ID: <20261026092957.2305785-1-wangqing7171@gmail.com> (raw)
In-Reply-To: <attrLy_Q-53FnjhL@thinkstation>

On Fri, 23 Oct 2026 at 22:22, Harry Yoo <harry@kernel.org> wrote:
> On Fri, Oct 23, 2026 at 05:44:01PM +0800, Qing Wang wrote:
> > kmem_cache_prefill_sheaf() and kmem_cache_refill_sheaf() only guarantee
> > @size objects, but for standard capacity sheaves
> > __prefill_sheaf_pfmemalloc() uses refill_sheaf(), which actually fills
> > the sheaf up to s->sheaf_capacity.
> >
> > The call thus fails with -ENOMEM > whenever the sheaf cannot be filled
> > completely, even when @size objects were already obtained.
> 
> This is extremely rare condition to happen, and so...

Yes, I went to measure the number of times of
kmem_cache_prefill_sheaf() and kmem_cache_refill_sheaf() in qemu. It's also
very low.

> 
> > This leads to needless flushing of the partially
> > filled sheaf in kmem_cache_prefill_sheaf(),
> 
> It doesn't make much sense to micro-optimize slab in low or out of
> memory situations.

I agree with you. Because it's so rare.

Thanks for your careful review.

--
Best regards,
Qing

      reply	other threads:[~2026-10-26  9:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23  9:44 [PATCH] mm/slab: only require the requested size when refilling prefilled sheaves Qing Wang
2026-10-23 14:22 ` Harry Yoo
2026-10-26  9:29   ` Qing Wang [this message]

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=20261026092957.2305785-1-wangqing7171@gmail.com \
    --to=wangqing7171@gmail.com \
    --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=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

all inboxes | Powered by JetHome®