Skip to content

ext4: port direct I/O to iomap infrastructure

Matthew Bobrowski linux-ext4 linux-fsdevel 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest11 patches 10 repliesIn review
  2. v611 patches 18 repliesSuperseded
  3. v512 patches 37 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v48 patches38 repliesSuperseded
v36 patches28 repliesSuperseded
v26 patches14 repliesSuperseded
v15 patches40 repliesSuperseded

Changes in v7 from the cover letter

- Removed duplicate map->m_flags check in ext4_set_iomap(), which cleaned up some of unnecessary levels of identation.

- Fixed an issue with the buffered I/O fallback path within ext4_dio_write_iter(). Previously, we only returned the value that ext4_buffered_write_iter() would return without taking into account anything that possibly written for the direct I/O. This meant that we'd return incorrect values back to userspace.

- Added missing fsync + page cache invalidation for written I/O range post buffered I/O fallback. This was missing from my original patch series, but this is actually needed in order to preserve direct I/O semantics.

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11ext4: reorder map.m_flags checks within ext4_iomap_begin()fs/ext4/inode.c+13 -30 replies
2/11ext4: update direct I/O read lock pattern for IOCB_NOWAITfs/ext4/inode.c+7 -10 replies
3/11ext4: iomap that extends beyond EOF should be marked dirtyfs/ext4/inode.c+7 -10 replies
4/11ext4: move set iomap routines into a separate helper ext4_set_iomap()fs/ext4/inode.c+48 -420 replies
5/11ext4: split IOMAP_WRITE branch in ext4_iomap_begin() into helperfs/ext4/inode.c+61 -520 replies
6/11ext4: introduce new callback for IOMAP_REPORTfs/ext4/ext4.h fs/ext4/file.c fs/ext4/inode.c+85 -561 reply
7/11ext4: introduce direct I/O read using iomap infrastructurefs/ext4/file.c fs/ext4/inode.c+54 -390 replies
8/11ext4: move inode extension/truncate code out from ->iomap_end() callbackfs/ext4/file.c fs/ext4/inode.c+89 -482 replies
9/11ext4: move inode extension check out from ext4_iomap_alloc()fs/ext4/file.c fs/ext4/inode.c+23 -230 replies
10/11ext4: update ext4_sync_file() to not use __generic_file_fsync()fs/ext4/fsync.c+47 -250 replies
11/11ext4: introduce direct I/O write using iomap infrastructurefs/ext4/ext4.h fs/ext4/extents.c fs/ext4/file.c +1 more+218 -4557 replies

Reviews trailers per patch

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

PatchJan KaraRitesh Harjani
1/11R-b R-b
2/11R-b R-b
3/11R-b R-b
4/11R-b R-b
5/11R-b R-b
6/11R-b R-b
7/11R-b R-b
8/11R-b R-b
9/11R-b R-b
10/11R-b R-b
11/11R-b R-b

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

Read the v7 thread

Cover letter [PATCH v7 00/11] ext4: port direct I/O to iomap infrastructure

Hi all,

This is an updated patch series of the ext4 direct I/O port to iomap infrastructure. This updated series includes some minor updates and fixes that were identified within the preceding patch series. Changlog since v6 has been summarised below:

Changes since v6:

- Removed duplicate map->m_flags check in ext4_set_iomap(), which cleaned up some of unnecessary levels of identation.

- Fixed an issue with the buffered I/O fallback path within ext4_dio_write_iter(). Previously, we only returned the value that ext4_buffered_write_iter() would return without taking into account anything that possibly written for the direct I/O. This meant that we'd return incorrect values back to userspace.

- Added missing fsync + page cache invalidation for written I/O range post buffered I/O fallback. This was missing from my original patch series, but this is actually needed in order to preserve direct I/O semantics.

The original cover letter for this series has been provided below for reference.

---

This patch series ports the ext4 direct IO paths to make use of the iomap infrastructure. The legacy buffer_head based direct IO paths have subsequently been removed as they're now no longer in use. The result of this change is that the direct IO implementation is much cleaner and keeps the code isolated from the buffer_head internals. In addition to this, a slight performance boost could be expected while using O_SYNC | O_DIRECT IO.

The changes have been tested using xfstests in both DAX and non-DAX modes using various filesystem configurations i.e. 4k, dioread_nolock, nojournal, ext3.

Matthew Bobrowski (11):
ext4: reorder map.m_flags checks within ext4_iomap_begin()
ext4: update direct I/O read lock pattern for IOCB_NOWAIT
ext4: iomap that extends beyond EOF should be marked dirty
ext4: move set iomap routines into a separate helper ext4_set_iomap()
ext4: split IOMAP_WRITE branch in ext4_iomap_begin() into helper
ext4: introduce new callback for IOMAP_REPORT
ext4: introduce direct I/O read using iomap infrastructure
ext4: move inode extension/truncate code out from ->iomap_end()
callback
ext4: move inode extension check out from ext4_iomap_alloc()
ext4: update ext4_sync_file() to not use __generic_file_fsync()
ext4: introduce direct I/O write using iomap infrastructure

 fs/ext4/ext4.h    |   4 +-
 fs/ext4/extents.c |  11 +-
 fs/ext4/file.c    | 412 +++++++++++++++++++++-----
 fs/ext4/fsync.c   |  72 +++--
 fs/ext4/inode.c   | 720 +++++++++++-----------------------------------
 5 files changed, 563 insertions(+), 656 deletions(-)
Signature · 1 line
2.20.1