Skip to content

Improve IOCB_NOWAIT O_DIRECT reads

Jens Axboe linux-fsdevel linux-mm 3 versions – Applied

Status from this message: [merged] iomap-use-filemap_range_needs_writeback-for-o_direct-reads.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 6 repliesApplied 3/3
  2. v23 patches 10 repliesSuperseded
  3. v13 patches 6 repliesSuperseded

Changes in v3 from the cover letter

- Drop overly long line (hch)
- Rebase to master, iomap changed flags to iomap_flags

Patches in v3 All 3 applied

#Subject and filesSizeRepliesApplied
1/3mm: provide filemap_range_needs_writeback() helperinclude/linux/fs.h mm/filemap.c+45 -03 repliesApplied
2/3mm: use filemap_range_needs_writeback() for O_DIRECT readsmm/filemap.c+2 -22 repliesApplied
3/3iomap: use filemap_range_needs_writeback() for O_DIRECT readsfs/iomap/direct-io.c+16 -81 replyApplied

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchMatthew Wilcox (Oracle)Jan Kara
1/3R-b R-b
2/3R-b R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCHSET v3 0/3] Improve IOCB_NOWAIT O_DIRECT reads

Hi,

For v1, see:

https://lore.kernel.org/linux-fsdevel/[email protected]/

tldr; don't -EAGAIN IOCB_NOWAIT dio reads just because we have page cache entries for the given range. This causes unnecessary work from the callers side, when the IO could have been issued totally fine without blocking on writeback when there is none.

 fs/iomap/direct-io.c | 24 ++++++++++++++--------
 include/linux/fs.h   |  2 ++
 mm/filemap.c         | 47 ++++++++++++++++++++++++++++++++++++++++++--
 3 files changed, 63 insertions(+), 10 deletions(-)

Andrew, any chance you can pick this up for 5.12?

Since v2:
- Drop overly long line (hch)
- Rebase to master, iomap changed flags to iomap_flags

Signature · 1 line
Jens Axboe