Internships/ProjectIdeas/IOUring: Difference between revisions

From QEMU
(Created page with "=== io_uring AIO engine === '''Summary:''' Add io_uring support to QEMU for high-performance disk I/O on Linux The io_uring interface supersedes the Linux AIO API for async...")
 
Line 21: Line 21:
* [https://lwn.net/Articles/776703/ io_uring article on LWN.net]
* [https://lwn.net/Articles/776703/ io_uring article on LWN.net]
* [https://git.qemu.org/?p=qemu.git;a=blob;f=block/linux-aio.c;h=d4b61fb2517d6b9fb6ff088d37180e3f4fb8792d;hb=HEAD QEMU linux-aio.c]
* [https://git.qemu.org/?p=qemu.git;a=blob;f=block/linux-aio.c;h=d4b61fb2517d6b9fb6ff088d37180e3f4fb8792d;hb=HEAD QEMU linux-aio.c]
* [http://git.kernel.dk/cgit/fio/plain/t/io_uring.c io_uring example program]


'''Details:'''
'''Details:'''

Revision as of 06:55, 1 February 2019

io_uring AIO engine

Summary: Add io_uring support to QEMU for high-performance disk I/O on Linux

The io_uring interface supersedes the Linux AIO API for asynchronous I/O. The core functionality of asynchronous I/O APIs is I/O request submission (reads/writes/flushes) and completion processing at a later point in time. Unlike a blocking read(2)/write(2) syscall, this allows the application threads to perform other activity while one or more I/O requests are in flight.

QEMU currently supports two asynchronous I/O engines: aio=threads (a thread-pool that invokes preadv(2)/pwritev(2)/fdatasync(2)) and aio=native (Linux AIO). This project will add io_uring support, which should achieve better performance than Linux AIO. This is because io_uring offers several optimizations:

  • Memory buffers can be registered (pinned) ahead of time to avoid pinning on each request
  • File descriptors can be held long-term to avoid the need to acquire them on each request
  • A single system call can both submit and complete I/O requests or polling mode can be used to avoid system calls altogether

This project consists of the following tasks:

  • Understanding the io_uring userspace ABI
  • Extending block/file-posix.c to use io_uring
  • Benchmarking io_uring against Linux AIO and aio=threads
  • Adding polling mode support for completions (similar to existing Linux AIO polling code in QEMU)
  • Stretch goal: Adding polling mode support for submissions
  • Stretch goal: Adding a fast path when QEMU block layer features are not in use

Links:

Details:

  • Skill level: intermediate
  • Language: C
  • Mentor: Stefan Hajnoczi <stefanha@redhat.com> ("stefanha" on IRC)