[Devel] [PATCH rh7 00/30] fs, direct_IO: Switch to iov_iter and allow bio_vec for ext4

Kirill Tkhai ktkhai at virtuozzo.com
Wed May 20 19:02:45 MSK 2020


This patchset transforms direct_IO callbacks, blockdev_direct_IO
and its underlining functions to iov_iter, and introduces complete
support of iov_iter for ext4.

Supported iov_iter subtypes for ext4 is iovec and bio_vec. The first
is for traditional user-submitted aio, while bio_vec is the type,
which is important for us, since we use it in ploop.

bio_vec operates with pages instead of user addresses (like iovec
does), so it requires specific callbacks in do_blockdev_direct_IO()
and in the functions it calls.

The patchset reworks do_blockdev_direct_IO() in the same manner
as in mainstrean. The most of rest patches are prepared manually,
since we have significant differences to ms (RHEL7 patches, our
direct IO patches for FUSE; all they have changed many functions).
At the end, kaio engine (resulting in direct_IO) became possible
to be enabled for ext4.

Fast check of memory consumption during direct write does not increase:
# free -h
              total        used        free      shared  buff/cache   available
Mem:           7,6G        276M        7,3G        8,9M        110M        7,2G
Swap:          7,9G          0B        7,9G
# dd if=/dev/urandom of=/ploop_mnt/file bs=1M count=512 oflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 8.16179 s, 65.8 MB/s
# free -h
              total        used        free      shared  buff/cache   available
Mem:           7,6G        276M        7,3G        8,9M        110M        7,2G
Swap:          7,9G          0B        7,9G
(no new memory became used)

---

Al Viro (8):
      fs/file.c: don't open-code kvfree()
      __btrfs_direct_write(): switch to iov_iter
      kill generic_segment_checks()
      give ->direct_IO() a copy of iov_iter
      new primitive: iov_iter_alignment()
      new helper: iov_iter_get_pages()
      new helper: iov_iter_npages()
      bio_vec-backed iov_iter

Boaz Harrosh (1):
      direct-io: fix uninitialized warning in do_direct_IO()

Christoph Hellwig (1):
      direct-io: fix AIO regression

Kirill Tkhai (19):
      fs: generic_file_direct_write() switch to iov_iter
      mm: Kill unused ->direct_IO_page
      mm: Use iov_iter in __swap_writepage()
      fs: Pass iov_iter to ->direct_IO
      fs: Kill ->direct_IO_bvec
      mm: Kill useless mapping_direct_IO()
      ext4: Use iov_iter argument in direct_IO functions
      fs: Replace iov_length() with its iov_iter synonym iov_iter_count()
      fs: blockdev_direct_IO: switch to iov_iter
      iot_iter: Add iov_iter_alignment()
      dio: take updating ->result into do_direct_IO()
      ext4: ext4_file_dio_write(): switch to iov_iter
      dax: dax_iomap_rw(): switch to iov_iter
      ext4: ext4_write_checks(): switch to iov_iter
      fs: More use iov_iter in ext4_file_write()
      ext4: ext4_file_dax_write() switch to iov_iter
      ext4: Introduce ext4_file_write_iter()
      ext4: Attach write_iter and read_iter
      ploop: Introduce possibility to use kaio engine for ext4

Ming Lei (1):
      fs: direct-io: don't dirtying pages for ITER_BVEC/ITER_KVEC direct read


 drivers/block/ploop/dev.c        |    4 +
 drivers/block/ploop/fmt_ploop1.c |    2 
 drivers/block/ploop/io_direct.c  |    4 +
 drivers/block/ploop/io_kaio.c    |   15 +--
 fs/9p/vfs_addr.c                 |    4 -
 fs/block_dev.c                   |    7 +-
 fs/btrfs/file.c                  |   28 ++----
 fs/btrfs/inode.c                 |    9 +-
 fs/ceph/addr.c                   |    4 -
 fs/ceph/file.c                   |   13 +--
 fs/cifs/file.c                   |    3 -
 fs/dax.c                         |   13 +--
 fs/direct-io.c                   |  176 +++++++++++++-------------------------
 fs/ext2/inode.c                  |   10 +-
 fs/ext3/inode.c                  |   13 +--
 fs/ext4/ext4.h                   |    3 -
 fs/ext4/file.c                   |   76 +++++++++-------
 fs/ext4/indirect.c               |   16 ++-
 fs/ext4/inode.c                  |   22 ++---
 fs/f2fs/data.c                   |    4 -
 fs/fat/inode.c                   |   10 +-
 fs/file.c                        |   11 +-
 fs/fuse/file.c                   |   34 ++++---
 fs/gfs2/aops.c                   |    9 +-
 fs/gfs2/file.c                   |    5 -
 fs/hfs/inode.c                   |    6 +
 fs/hfsplus/inode.c               |    6 +
 fs/jfs/inode.c                   |    6 +
 fs/libfs.c                       |    4 -
 fs/nfs/direct.c                  |    4 +
 fs/nilfs2/inode.c                |    8 +-
 fs/ntfs/file.c                   |    5 -
 fs/ocfs2/aops.c                  |    7 +-
 fs/ocfs2/file.c                  |   17 ++--
 fs/reiserfs/inode.c              |    7 +-
 fs/udf/file.c                    |    4 -
 fs/udf/inode.c                   |    8 +-
 fs/xfs/xfs_file.c                |   43 +++++----
 include/linux/dax.h              |    4 -
 include/linux/fs.h               |   30 +++---
 include/linux/nfs_fs.h           |    3 -
 include/linux/ploop/ploop.h      |    1 
 mm/filemap.c                     |  109 ++----------------------
 mm/iov-iter.c                    |  170 +++++++++++++++++++++++++++++++++++++
 mm/page_io.c                     |    5 +
 mm/shmem.c                       |    7 --
 46 files changed, 470 insertions(+), 479 deletions(-)

--
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>



More information about the Devel mailing list