From: Hao Li <hao.li@linux.dev>
To: hu.shengming@zte.com.cn
Cc: vbabka@kernel.org, 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,
zhang.run@zte.com.cn, xu.xin16@zte.com.cn,
yang.tao172@zte.com.cn, yang.yang29@zte.com.cn
Subject: Re: [PATCH v2] mm/slub: skip freelist construction for whole-slab bulk refill
Date: Thu, 2 Apr 2026 17:07:35 +0800 [thread overview]
Message-ID: <sulhwzij76rurwi22fxwegf6bm26efmkz6tqeey22ismy3z5z3@ml73mrdwlibb> (raw)
In-Reply-To: <202604012156491419-Nl283guZ6jw8h0k2omv@zte.com.cn>
On Wed, Apr 01, 2026 at 09:56:49PM +0800, hu.shengming@zte.com.cn wrote:
[...]
> > > +static inline bool bulk_refill_consumes_whole_slab(struct kmem_cache *s,
> > > + unsigned int count)
> > > +{
> > > + return count >= oo_objects(s->oo);
> >
> > It seems using s->oo here may be a bit too strict. In allocate_slab(), the
> > object count can fall back to s->min, so using s->objects might be more
> > reasonable (If I understand correctly...).
> >
>
> Good point. I do not see s->objects in current linux-next; did you mean
> slab->objects?
>
> oo_objects(s->oo) is the preferred-layout object count, while the actual
> object count of a newly allocated slab is only known after allocate_slab(),
> via slab->objects, since allocation can fall back to s->min.
>
> So I used oo_objects(s->oo) because this check happens before slab
> allocation. It is conservative, but safe.
Oh, right.. sorry, I misread that. Please ignore this point..
next prev parent reply other threads:[~2026-04-02 9:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-01 4:57 hu.shengming
2026-04-01 6:55 ` Hao Li
2026-04-01 13:56 ` hu.shengming
2026-04-02 9:07 ` Hao Li [this message]
2026-04-02 4:53 ` Harry Yoo (Oracle)
2026-04-02 7:03 ` hu.shengming
2026-04-02 8:12 ` Harry Yoo (Oracle)
2026-04-02 9:00 ` 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=sulhwzij76rurwi22fxwegf6bm26efmkz6tqeey22ismy3z5z3@ml73mrdwlibb \
--to=hao.li@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=cl@gentwo.org \
--cc=harry@kernel.org \
--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=xu.xin16@zte.com.cn \
--cc=yang.tao172@zte.com.cn \
--cc=yang.yang29@zte.com.cn \
--cc=zhang.run@zte.com.cn \
/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