Files
xemu/util
Stefan Hajnoczi 047dabef97 block/io_uring: use aio_add_sqe()
AioContext has its own io_uring instance for file descriptor monitoring.
The disk I/O io_uring code was developed separately. Originally I
thought the characteristics of file descriptor monitoring and disk I/O
were too different, requiring separate io_uring instances.

Now it has become clear to me that it's feasible to share a single
io_uring instance for file descriptor monitoring and disk I/O. We're not
using io_uring's IOPOLL feature or anything else that would require a
separate instance.

Unify block/io_uring.c and util/fdmon-io_uring.c using the new
aio_add_sqe() API that allows user-defined io_uring sqe submission. Now
block/io_uring.c just needs to submit readv/writev/fsync and most of the
io_uring-specific logic is handled by fdmon-io_uring.c.

There are two immediate advantages:
1. Fewer system calls. There is no need to monitor the disk I/O io_uring
   ring fd from the file descriptor monitoring io_uring instance. Disk
   I/O completions are now picked up directly. Also, sqes are
   accumulated in the sq ring until the end of the event loop iteration
   and there are fewer io_uring_enter(2) syscalls.
2. Less code duplication.

Note that error_setg() messages are not supposed to end with
punctuation, so I removed a '.' for the non-io_uring build error
message.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-ID: <20251104022933.618123-15-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2025-11-11 22:06:09 +01:00
..
2025-11-11 22:06:09 +01:00
2023-12-19 19:03:38 +01:00
2025-01-16 20:57:17 -08:00
2024-09-20 10:00:27 +03:00
2025-10-01 08:33:24 +02:00
2024-09-13 20:11:13 +02:00
2025-03-10 17:07:16 +08:00
2025-10-01 11:22:07 -04:00
2025-01-29 11:43:04 -03:00
2024-06-21 09:47:22 -03:00
2025-10-03 09:48:02 -04:00
2025-10-03 09:48:02 -04:00
2023-11-15 12:06:05 +03:00
2025-10-28 12:39:59 +01:00
2024-06-19 12:42:03 +02:00
2023-11-03 09:20:31 +01:00