linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "changfengnan" <changfengnan@bytedance.com>
To: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Cc: "Dave Chinner" <david@fromorbit.com>,
	"Harry Yoo" <harry.yoo@oracle.com>,  "Hao Li" <hao.li@linux.dev>,
	"guzebing" <guzebing1612@gmail.com>,  <brauner@kernel.org>,
	<djwong@kernel.org>, <hch@infradead.org>,
	 <linux-xfs@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>,
	 <linux-kernel@vger.kernel.org>, <guzebing@bytedance.com>,
	 <syzbot@syzkaller.appspotmail.com>, <linux-mm@kvack.org>
Subject: Re: [PATCH v3] iomap: add allocation cache for iomap_dio
Date: Tue, 17 Mar 2026 16:33:24 +0800	[thread overview]
Message-ID: <d9210bcdf73fbe1ac8b6ec132865609a3ed68688.b89f1572.8ddd.443e.a91a.9f6964f1a150@bytedance.com> (raw)
In-Reply-To: <abeb4474-8f3a-49c4-bb73-50f2a633d179@kernel.org>


> From: "Vlastimil Babka (SUSE)"<vbabka@kernel.org>
> Date:  Tue, Mar 17, 2026, 16:28
> Subject:  Re: [PATCH v3] iomap: add allocation cache for iomap_dio
> To: "changfengnan"<changfengnan@bytedance.com>
> Cc: "Dave Chinner"<david@fromorbit.com>, "Harry Yoo"<harry.yoo@oracle.com>, "Hao Li"<hao.li@linux.dev>, "guzebing"<guzebing1612@gmail.com>, <brauner@kernel.org>, <djwong@kernel.org>, <hch@infradead.org>, <linux-xfs@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <guzebing@bytedance.com>, <syzbot@syzkaller.appspotmail.com>, <linux-mm@kvack.org>
> On 3/17/26 08:28, changfengnan wrote:
> > 
> >> That suggests in that test you used larger capacity than the automatically
> >> calculated.
> > The 10% improvement is due to the every cache has sheaves.
> > When I tested 256-byte objects, default sheaf_capacity is 26, allocating and
> > freeing 32 objects did not show a noticeable difference, but allocating and
> > freeing 128 objects resulted in a significant improvement, about 3-4x in a 
> > multithreaded environment.  about 12% improvement in single thread.
> 
> Great!
> 
> >>  
> >> > I'm thinking that maybe these improvements may not be significant enough to
> >> > see the effect in the io flow.
> >> > Using a simple list seems to be the most efficient approach.
> >> 
> >> I think the question is, what improvement do you now see with your added
> >> pcpu cache vs kmalloc() when 7.0-rc4 is used as the baseline?
> > 
> > On 7.0-rc4, pcpu get 1.20M IOPS , kmalloc get 1.19M IOPS, new cache with set sheaf_capacity 256, 1.19M IOPS
> > On 6.19, pcpu get 1.20M IOPS,  kmalloc get 1.17M IOPS, new cache with set sheaf_capacity 256, 1.19M IOPS.
> 
> Thanks a lot for that data. My conclusion is that kmalloc before sheaves did
> indeed worse and custom pcpu cache improved it relatively more. Kmalloc with
> sheaves does better, and the improvement of custom pcpu cache is smaller.
> Also the default sheaf capacity seems to be enough for this workload.
Agree.
> 
> IO is not my area but getting from 1.19M to 1.20M doesn't look like it's
> worth the custom code? (possibly from 1.17M to 1.20M it also wasn't).
Yes, at least for now, there’s no need for a per-CPU.
It might be better to replace kmalloc with a new cache, but my tests so far
haven’t shown any performance improvements.  I’ll look into it further.



  reply	other threads:[~2026-03-17  8:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260115021108.1913695-1-guzebing1612@gmail.com>
2026-01-15  5:02 ` Dave Chinner
2026-03-16 11:22   ` changfengnan
2026-03-16 16:54     ` Vlastimil Babka (SUSE)
2026-03-17  7:28       ` changfengnan
2026-03-17  8:27         ` Vlastimil Babka (SUSE)
2026-03-17  8:33           ` changfengnan [this message]
2026-03-17  9:12             ` Christoph Hellwig
2026-03-17  9:19               ` changfengnan
2026-03-17  9:21               ` 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=d9210bcdf73fbe1ac8b6ec132865609a3ed68688.b89f1572.8ddd.443e.a91a.9f6964f1a150@bytedance.com \
    --to=changfengnan@bytedance.com \
    --cc=brauner@kernel.org \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=guzebing1612@gmail.com \
    --cc=guzebing@bytedance.com \
    --cc=hao.li@linux.dev \
    --cc=harry.yoo@oracle.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=syzbot@syzkaller.appspotmail.com \
    --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