All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET v2] Support for polled aio
@ 2018-11-20 17:19 Jens Axboe
  2018-11-20 17:19 ` [PATCH 1/8] fs: add file_operations ->iopoll() handler Jens Axboe
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Jens Axboe @ 2018-11-20 17:19 UTC (permalink / raw)
  To: linux-block, linux-aio, linux-fsdevel

For the grand introduction to this feature, see my original posting
here:

https://lore.kernel.org/linux-block/20181117235317.7366-1-axboe@kernel.dk/

Since last time, a number of significant changes has been made:

- Addition of the io_setup2() system call. I didn't like tracking the
  fact that an io_context was polled or not internally, I think it's
  much better to make this explicit. The system call is like io_setup(),
  except we pass in a flags argument. In the flags, the application can
  set IOCTX_FLAG_IOPOLL to ask for this context to be polled. The syscall
  is only wired up for x86-64 for now.

- Addition of fops->iopoll() to properly handle polling on files.

- Various optimizations to how we track and handle poll requests
  internally.

- Split some patches into prep patches, to reduce the size of the
  final poll support patch.

- Various cleanups, tweaks, improvements.

In terms of efficiency, I've got one device that maxes out at 845K
4k IOPS, and the polled IO can reach this with just a single thread/core.
For comparison, non-polled on the same device reaches 600K IOPS. On
a slightly faster device, I can reach 910K IOPS on a single thread. All
of this is on a 2.2GHz server box, faster clock rate will go faster.

In terms of how to use polling, I'd advise you to check out the basic
changes made to fio to support it. It's simple:

1) Ensure that you call io_setup2() with IOCTX_FLAG_IOPOLL, instead
   of io_queue_init() or io_setup().
2) Set iocb->u.c.flags to IOCB_FLAG_HIPRI.

That's it, everything else works like before.

Patches are against my mq-perf branch, and can also be found in my
aio poll branch.

 arch/x86/entry/syscalls/syscall_64.tbl |   1 +
 fs/aio.c                               | 469 +++++++++++++++++++++----
 fs/block_dev.c                         |  25 +-
 fs/iomap.c                             |  50 ++-
 fs/xfs/xfs_file.c                      |   1 +
 include/linux/fs.h                     |   1 +
 include/linux/iomap.h                  |   1 +
 include/linux/syscalls.h               |   2 +
 include/uapi/asm-generic/unistd.h      |   4 +-
 include/uapi/linux/aio_abi.h           |   4 +
 kernel/sys_ni.c                        |   1 +
 11 files changed, 461 insertions(+), 98 deletions(-)

-- 
Jens Axboe



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

end of thread, other threads:[~2018-11-22 21:01 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-20 17:19 [PATCHSET v2] Support for polled aio Jens Axboe
2018-11-20 17:19 ` [PATCH 1/8] fs: add file_operations ->iopoll() handler Jens Axboe
2018-11-20 17:19 ` [PATCH 2/8] block: wire up block device ->iopoll() Jens Axboe
2018-11-20 17:19 ` [PATCH 3/8] iomap/xfs: wire up file_operations ->iopoll() Jens Axboe
2018-11-21  9:15   ` Benny Halevy
2018-11-21 13:27     ` Jens Axboe
2018-11-20 17:19 ` [PATCH 4/8] aio: use assigned completion handler Jens Axboe
2018-11-20 17:19 ` [PATCH 5/8] aio: fix failure to put the file pointer Jens Axboe
2018-11-20 17:19 ` [PATCH 6/8] aio: add io_setup2() system call Jens Axboe
2018-11-20 17:19 ` [PATCH 7/8] aio: separate out ring reservation from req allocation Jens Axboe
2018-11-20 17:19 ` [PATCH 8/8] aio: support for IO polling Jens Axboe
2018-11-21 11:12   ` Benny Halevy
2018-11-21 13:26     ` Jens Axboe
2018-11-21 13:51       ` Benny Halevy
2018-11-22 11:13   ` Jan Kara
2018-11-22 21:01     ` Jens Axboe

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.