Re: [PATCH v6 3/3] iomap: add simple dio path for small direct I/O
From: changfengnan
Date: Fri Jul 03 2026 - 05:19:40 EST
> From: "Joanne Koong"<joannelkoong@xxxxxxxxx>
> Date: Fri, Jul 3, 2026, 11:06
> Subject: Re: [PATCH v6 3/3] iomap: add simple dio path for small direct I/O
> To: "Christoph Hellwig"<hch@xxxxxxxxxxxxx>
> Cc: "Fengnan Chang"<changfengnan@xxxxxxxxxxxxx>, <brauner@xxxxxxxxxx>, <djwong@xxxxxxxxxx>, <ojaswin@xxxxxxxxxxxxx>, <dgc@xxxxxxxxxx>, <linux-xfs@xxxxxxxxxxxxxxx>, <linux-fsdevel@xxxxxxxxxxxxxxx>, <linux-ext4@xxxxxxxxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>, <lidiangang@xxxxxxxxxxxxx>, <pankaj.raghav@xxxxxxxxx>, "Brian Foster"<bfoster@xxxxxxxxxx>
> On Thu, Jul 2, 2026 at 7:35 AM Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
> >
> > On Wed, Jul 01, 2026 at 12:35:24PM -0700, Joanne Koong wrote:
> > > I think it ends up being pretty simple to get it integrated since
> > > ->iomap_next already contains the logic to only begin the mapping at
> > > the start and only finish the mapping when the iter has been fully
> > > consumed, eg
> >
> > I wonder if this adds overhead that the simple path removed.
>
> Ah I see now, the whole point of Fengnan's series is to k eep the
> logic minimal...
Hi Christoph and Joanne:
I ran some tests on the simple read path with iomap next patch, and
the results showed a 2%–3% drop in performance, with IOPS falling
from 2.04–2.05M to 2.0M.
Patch 1 added `iomap_dio_simple_finish_iter`, and now this function
is executed for every I/O operation. However, in the previous code,
when `ops->iomap_end` was null for ext4 and XFS, no action was
taken, which introduced some overhead.
I implemented some optimizations based on Christoph’s suggestions and
made some modifications to `iomap_process`;
Now, XFS performance is essentially unchanged, while ext4 still shows a
1.5% drop; I will continue to investigate the cause.. I’ve attached the patch.
Actually, I had expected that switching to `iomap_next` would improve
performance, since it avoids an indirect call.
[1] https://lore.kernel.org/linux-fsdevel/CAJnrk1ZZCBexaYUCe0s2_kfbAZVKrdhSXFCRv=cy1ggcxRhSPw@xxxxxxxxxxxxxx/
>
> Fengnan, I think you had mentioned earlier [1] that enabling
> iomap_next brought the simple-read gain down from 10% to 7%? Thanks
> for running those numbers. Would you be able to share the changes you
> made to iomap_dio_rw to support iomap_next for those benchmarks you
> ran?
>
> Thanks,
> Joanne
>
> [1] https://lore.kernel.org/linux-fsdevel/e85e73bd-5fbe-4d11-89ba-7b42c237dd34@xxxxxxxxxxxxx/
>
Attachment:
0002-iomap-inline-iomap_iter_advance-and-hoist-the-zero-l.patch
Description: Binary data
Attachment:
0001-iomap-skip-the-finishing-iomap_iter-on-the-simple-DI.patch
Description: Binary data