All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] iov_iter: Add new iters and use with AFS
@ 2018-09-13 15:51 David Howells
  2018-09-13 15:51 ` [PATCH 01/10] iov_iter: Separate type from direction and use accessor functions David Howells
                   ` (11 more replies)
  0 siblings, 12 replies; 21+ messages in thread
From: David Howells @ 2018-09-13 15:51 UTC (permalink / raw)
  To: viro; +Cc: dhowells, linux-fsdevel, linux-afs, linux-kernel


Hi Al,

Here's a set of patches that adds two new iov_iter types and then makes AFS
use them to do I/O.  The iov_iter changes are:

 (1) Separate the type from the direction in the iov_iter struct and
     provide accessor functions to wrap type checking.

 (2) Renumber the type constants to be contiguous small unsigned integers,
     starting from 0 and then use switch-statements rather than if-else
     chains using bit-testing.

     Note that the compiler can optimise this better by using CMP rather
     than AND/TEST, say, as comparing integers requires fewer CMP
     instructions or can use jump tables.

 (3) Change iov_offset from size_t to loff_t.  This allows iov_offset to be
     then used as a byte offset with ITER_MAPPING and allows 4GiB and larger
     reads and writes to be proposed.

     This makes no difference on a 64-bit system, but does make a 32-bit
     compilation a bit larger.

 (4) Add an ITER_MAPPING iterator type.  This provides an iterator that
     directly accesses an address_space, and assumes that the target pages
     are in some way locked (eg. PG_lock or PG_writeback).

 (5) Add an ITER_DISCARD iterator type.  This provides an iterator that
     simply discards anything written to it.  It cannot be used as a data
     source.

The afs changes are:

 (1) Use a single ITER_MAPPING iterator to cover all the data read by a
     single FetchData RPC op.  This involves switching the operation to an
     ITER_KVEC iterator to read the status record that's transmitted after
     the data.

 (2) Use an ITER_DISCARD iterator to discard any extra data the server may
     have included that we don't want.

 (3) Use a single ITER_MAPPING iterator to cover all the data written by a
     single StoreData RPC op.

 (4) Add synchronous O_DIRECT read support.

This should also be useful for doing direct I/O from cachefiles.

The patches can be found here also:

	http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=afs-iov

David
---
David Howells (10):
      iov_iter: Separate type from direction and use accessor functions
      iov_iter: Renumber the ITER_* constants in uio.h
      iov_iter: Make count and iov_offset loff_t not size_t
      iov_iter: Add mapping and discard iterator types
      afs: Better tracing of protocol errors
      afs: Set up the iov_iter before calling afs_extract_data()
      afs: Use ITER_MAPPING for writing
      afs: Add O_DIRECT read support
      afs: Add a couple of tracepoints to log I/O errors
      afs: Don't invoke the server to read data beyond EOF


 block/bio.c                              |    2 
 drivers/block/drbd/drbd_main.c           |    2 
 drivers/block/drbd/drbd_receiver.c       |    2 
 drivers/block/loop.c                     |    9 
 drivers/block/nbd.c                      |   12 -
 drivers/isdn/mISDN/l1oip_core.c          |    3 
 drivers/misc/vmw_vmci/vmci_queue_pair.c  |    6 
 drivers/nvme/target/io-cmd-file.c        |    2 
 drivers/target/iscsi/iscsi_target_util.c |    6 
 drivers/target/target_core_file.c        |    6 
 drivers/usb/usbip/usbip_common.c         |    2 
 drivers/xen/pvcalls-back.c               |    8 
 fs/9p/vfs_addr.c                         |    4 
 fs/9p/vfs_dir.c                          |    2 
 fs/9p/xattr.c                            |    4 
 fs/afs/cmservice.c                       |   56 +--
 fs/afs/dir.c                             |  208 ++++++++---
 fs/afs/file.c                            |  262 ++++++++++----
 fs/afs/fsclient.c                        |  409 ++++++++-------------
 fs/afs/inode.c                           |    2 
 fs/afs/internal.h                        |   81 +++-
 fs/afs/mntpt.c                           |    6 
 fs/afs/rxrpc.c                           |  156 ++------
 fs/afs/server.c                          |    4 
 fs/afs/vlclient.c                        |  134 +++----
 fs/afs/volume.c                          |    2 
 fs/afs/write.c                           |  112 ++++--
 fs/block_dev.c                           |    2 
 fs/btrfs/file.c                          |    7 
 fs/ceph/file.c                           |    7 
 fs/cifs/connect.c                        |    4 
 fs/cifs/file.c                           |    4 
 fs/cifs/misc.c                           |    4 
 fs/cifs/smb2ops.c                        |    4 
 fs/cifs/smbdirect.c                      |   17 +
 fs/cifs/transport.c                      |    8 
 fs/direct-io.c                           |    2 
 fs/dlm/lowcomms.c                        |    2 
 fs/fuse/file.c                           |    2 
 fs/iomap.c                               |    2 
 fs/nfs/direct.c                          |    2 
 fs/nfsd/vfs.c                            |    4 
 fs/ocfs2/cluster/tcp.c                   |    2 
 fs/orangefs/inode.c                      |    2 
 fs/splice.c                              |    7 
 include/linux/fscache.h                  |   31 ++
 include/linux/uio.h                      |   69 ++--
 include/trace/events/afs.h               |  202 ++++++++---
 lib/iov_iter.c                           |  572 ++++++++++++++++++++++++------
 mm/filemap.c                             |    2 
 mm/page_io.c                             |    2 
 net/9p/client.c                          |    4 
 net/9p/trans_virtio.c                    |    2 
 net/bluetooth/6lowpan.c                  |    2 
 net/bluetooth/a2mp.c                     |    2 
 net/bluetooth/smp.c                      |    2 
 net/ceph/messenger.c                     |    6 
 net/netfilter/ipvs/ip_vs_sync.c          |    2 
 net/smc/smc_clc.c                        |    4 
 net/socket.c                             |    6 
 net/sunrpc/svcsock.c                     |    2 
 net/tipc/topsrv.c                        |    2 
 net/tls/tls_device.c                     |    4 
 net/tls/tls_sw.c                         |    4 
 64 files changed, 1551 insertions(+), 953 deletions(-)

^ permalink raw reply	[flat|nested] 21+ messages in thread
* [PATCH 00/10] iov_iter: Add new iters and use with AFS
@ 2018-08-06 13:16 David Howells
  2018-08-06 13:17 ` [PATCH 04/10] iov_iter: Add mapping and discard iterator types David Howells
  0 siblings, 1 reply; 21+ messages in thread
From: David Howells @ 2018-08-06 13:16 UTC (permalink / raw)
  To: viro; +Cc: dhowells, linux-afs, linux-fsdevel, linux-kernel, matthew


Hi Al,

Here's a set of patches that adds two new iov_iter types and then makes AFS
use them to do I/O.  The iov_iter changes are:

 (1) Separate the type from the direction in the iov_iter struct and
     provide accessor functions to wrap type checking.

 (2) Renumber the type constants to be contiguous small unsigned integers,
     starting from 0 and then use switch-statements rather than if-else
     chains using bit-testing.

     Note that the compiler can optimise this better by using CMP rather
     than AND/TEST, say, as comparing integers requires fewer CMP
     instructions or can use jump tables.

 (3) Change count and iov_offset from size_t to loff_t.  This allows
     iov_offset to be then used as a byte offset with ITER_MAPPING and
     allows 4GiB and larger reads and writes to be proposed.

     This makes no difference on a 64-bit system, but does make a 32-bit
     compilation a bit larger.  Possibly only iov_offset really needs to be
     made loff_t and size >= 4GiB should just be disallowed on 32-bit.

 (4) Add an ITER_MAPPING iterator type.  This provides an iterator that
     directly accesses an address_space, and assumes that the target pages
     are in some way locked (eg. PG_lock or PG_writeback).

 (5) Add an ITER_DISCARD iterator type.  This provides an iterator that
     simply discards anything written to it.  It cannot be used as a data
     source.

The afs changes are:

 (1) Use a single ITER_MAPPING iterator to cover all the data read by a
     single FetchData RPC op.  This involves switching the operation to an
     ITER_KVEC iterator to read the status record that's transmitted after
     the data.

 (2) Use an ITER_DISCARD iterator to discard any extra data the server may
     have included that we don't want.

 (3) Use a single ITER_MAPPING iterator to cover all the data written by a
     single StoreData RPC op.

 (4) Add synchronous O_DIRECT read support.

The patches can be found here also:

	http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=afs-next

David
---
David Howells (10):
      iov_iter: Separate type from direction and use accessor functions
      iov_iter: Renumber the ITER_* constants in uio.h
      iov_iter: Make count and iov_offset loff_t not size_t
      iov_iter: Add mapping and discard iterator types
      afs: Better tracing of protocol errors
      afs: Set up the iov_iter before calling afs_extract_data()
      afs: Use ITER_MAPPING for writing
      afs: Add O_DIRECT read support
      afs: Add a couple of tracepoints to log I/O errors
      afs: Don't invoke the server to read data beyond EOF


 block/bio.c                              |    2 
 drivers/block/drbd/drbd_main.c           |    2 
 drivers/block/drbd/drbd_receiver.c       |    2 
 drivers/block/loop.c                     |    9 
 drivers/block/nbd.c                      |   12 -
 drivers/isdn/mISDN/l1oip_core.c          |    3 
 drivers/misc/vmw_vmci/vmci_queue_pair.c  |    6 
 drivers/nvme/target/io-cmd-file.c        |    2 
 drivers/target/iscsi/iscsi_target_util.c |    6 
 drivers/target/target_core_file.c        |    6 
 drivers/usb/usbip/usbip_common.c         |    2 
 drivers/xen/pvcalls-back.c               |    8 
 fs/9p/vfs_addr.c                         |    4 
 fs/9p/vfs_dir.c                          |    2 
 fs/9p/vfs_file.c                         |    2 
 fs/9p/xattr.c                            |    4 
 fs/afs/cmservice.c                       |   56 +--
 fs/afs/dir.c                             |  210 ++++++++---
 fs/afs/file.c                            |  263 ++++++++++----
 fs/afs/fsclient.c                        |  409 ++++++++-------------
 fs/afs/inode.c                           |    2 
 fs/afs/internal.h                        |   81 +++-
 fs/afs/mntpt.c                           |    2 
 fs/afs/rxrpc.c                           |  156 ++------
 fs/afs/server.c                          |    4 
 fs/afs/vlclient.c                        |  134 +++----
 fs/afs/volume.c                          |    2 
 fs/afs/write.c                           |  112 ++++--
 fs/block_dev.c                           |    2 
 fs/btrfs/file.c                          |    7 
 fs/ceph/file.c                           |    7 
 fs/cifs/connect.c                        |    4 
 fs/cifs/file.c                           |    4 
 fs/cifs/misc.c                           |    4 
 fs/cifs/smb2ops.c                        |    4 
 fs/cifs/smbdirect.c                      |   17 +
 fs/cifs/transport.c                      |    8 
 fs/direct-io.c                           |    2 
 fs/dlm/lowcomms.c                        |    2 
 fs/fuse/file.c                           |    2 
 fs/iomap.c                               |    2 
 fs/nfs/direct.c                          |    2 
 fs/nfs/file.c                            |    4 
 fs/nfsd/vfs.c                            |    4 
 fs/ocfs2/cluster/tcp.c                   |    2 
 fs/orangefs/inode.c                      |    2 
 fs/splice.c                              |    7 
 include/linux/fscache.h                  |   31 ++
 include/linux/uio.h                      |   71 ++--
 include/trace/events/afs.h               |  202 ++++++++---
 lib/iov_iter.c                           |  572 ++++++++++++++++++++++++------
 mm/filemap.c                             |    2 
 mm/page_io.c                             |    2 
 net/9p/client.c                          |    4 
 net/9p/trans_virtio.c                    |    2 
 net/bluetooth/6lowpan.c                  |    2 
 net/bluetooth/a2mp.c                     |    2 
 net/bluetooth/smp.c                      |    2 
 net/ceph/messenger.c                     |    6 
 net/netfilter/ipvs/ip_vs_sync.c          |    2 
 net/rxrpc/recvmsg.c                      |    4 
 net/smc/smc_clc.c                        |    4 
 net/socket.c                             |    6 
 net/sunrpc/svcsock.c                     |    2 
 net/tipc/topsrv.c                        |    2 
 net/tls/tls_device.c                     |    4 
 net/tls/tls_sw.c                         |    4 
 67 files changed, 1555 insertions(+), 960 deletions(-)

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2018-09-18  3:01 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-13 15:51 [PATCH 00/10] iov_iter: Add new iters and use with AFS David Howells
2018-09-13 15:51 ` [PATCH 01/10] iov_iter: Separate type from direction and use accessor functions David Howells
2018-09-13 15:51 ` [PATCH 02/10] iov_iter: Renumber the ITER_* constants in uio.h David Howells
2018-09-13 15:52 ` [PATCH 03/10] iov_iter: Make count and iov_offset loff_t not size_t David Howells
2018-09-13 15:52 ` [PATCH 04/10] iov_iter: Add mapping and discard iterator types David Howells
2018-09-14  4:18   ` Al Viro
2018-09-14 12:57     ` Trond Myklebust
2018-09-17 21:32       ` David Howells
2018-09-17 20:58     ` David Howells
2018-09-13 15:52 ` [PATCH 05/10] afs: Better tracing of protocol errors David Howells
2018-09-13 15:52 ` [PATCH 06/10] afs: Set up the iov_iter before calling afs_extract_data() David Howells
2018-09-13 15:52 ` [PATCH 07/10] afs: Use ITER_MAPPING for writing David Howells
2018-09-13 15:52 ` [PATCH 08/10] afs: Add O_DIRECT read support David Howells
2018-09-13 15:52 ` [PATCH 09/10] afs: Add a couple of tracepoints to log I/O errors David Howells
2018-09-13 15:52 ` [PATCH 10/10] afs: Don't invoke the server to read data beyond EOF David Howells
2018-09-13 16:10 ` [PATCH 00/10] iov_iter: Add new iters and use with AFS Matthew Wilcox
2018-09-13 16:18   ` David Howells
2018-09-13 16:43     ` Matthew Wilcox
2018-09-13 17:05       ` David Howells
2018-09-13 17:58 ` Al Viro
  -- strict thread matches above, loose matches on Subject: below --
2018-08-06 13:16 David Howells
2018-08-06 13:17 ` [PATCH 04/10] iov_iter: Add mapping and discard iterator types David Howells

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.