You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/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>
4 days ago
..
aio-posix.c aio-posix: add aio_add_sqe() API for user-defined io_uring requests 4 days ago
aio-posix.h aio-posix: add aio_add_sqe() API for user-defined io_uring requests 4 days ago
aio-wait.c aio-wait: avoid AioContext lock in aio_wait_bh_oneshot() 3 years ago
aio-win32.c aio: add errp argument to aio_context_setup() 4 days ago
aiocb.c
async.c block/io_uring: use aio_add_sqe() 4 days ago
atomic64.c osdep: Move memalign-related functions to their own header 4 years ago
base64.c
bitmap.c migration: Use non-atomic ops for clear log bitmap 3 years ago
bitops.c replace TABs with spaces 3 years ago
block-helpers.c block: Adjust check_block_size() signature 1 year ago
block-helpers.h block: Adjust check_block_size() signature 1 year ago
buffer.c
bufferiszero.c util/bufferiszero: Split out host include files 1 year ago
cacheflush.c buildsys: Remove support for 32-bit PPC hosts 1 month ago
chardev_open.c util/char_dev: Add open_cdev() 2 years ago
compatfd.c util: replace pipe()+cloexec with g_unix_open_pipe() 4 years ago
coroutine-sigaltstack.c osdep: set _FORTIFY_SOURCE=2 when optimization is enabled 2 years ago
coroutine-ucontext.c coroutine-ucontext: Save fake stack for pooled coroutine 2 years ago
coroutine-wasm.c util: Add coroutine backend for emscripten 6 months ago
coroutine-windows.c build: move coroutine backend selection to meson 3 years ago
cpuinfo-aarch64.c util/cpuinfo: Make use of elf_aux_info(3) on OpenBSD 1 year ago
cpuinfo-i386.c cpuinfo/i386: Detect GFNI as an AVX extension 2 months ago
cpuinfo-loongarch.c util/loongarch64: Detect LASX vector support 1 year ago
cpuinfo-ppc.c util/cpuinfo: Make use of elf_aux_info(3) on OpenBSD 1 year ago
cpuinfo-riscv.c util/cpuinfo-riscv: Detect Zbs 10 months ago
crc-ccitt.c
crc32c.c igb: Implement Rx SCTP CSO 3 years ago
cutils.c util/cutils: Remove unused qemu_get_exec_dir 1 year ago
dbus.c
defer-call.c util/defer-call: move defer_call() to util/ 2 years ago
drm.c
envlist.c envlist: Remove unused envlist_parse 1 year ago
error-report.c Remove glib compatibility code that is not required anymore 2 years ago
error.c error: Kill @error_warn 2 months ago
event.c qemu-thread: Use futex for QemuEvent on Windows 5 months ago
event_notifier-posix.c treewide: use qemu_set_blocking instead of g_unix_set_fd_nonblocking 2 months ago
event_notifier-win32.c Remove qemu-common.h include from most units 4 years ago
fdmon-epoll.c aio-posix: integrate fdmon into glib event loop 4 days ago
fdmon-io_uring.c aio-posix: add aio_add_sqe() API for user-defined io_uring requests 4 days ago
fdmon-poll.c aio-posix: integrate fdmon into glib event loop 4 days ago
fifo8.c fifo8: introduce fifo8_peek() function 1 year ago
filemonitor-inotify.c util/filemonitor-inotify.c: spelling fix: kenel 2 years ago
filemonitor-stub.c
getauxval.c util/cpuinfo: Make use of elf_aux_info(3) on OpenBSD 1 year ago
guest-random.c util/guest-random: Clean up global variable shadowing 2 years ago
hbitmap.c qapi/crypto: Rename QCryptoHashAlgorithm to *Algo, and drop prefix 1 year ago
hexdump.c util/hexdump: fix QEMU_HEXDUMP_LINE_WIDTH logic 2 weeks ago
host-utils.c host-utils: Implemented signed 256-by-128 division 3 years ago
id.c
int128.c include/qemu/int128: Use Int128 structure for TCI 3 years ago
interval-tree.c util/interval-tree: Check root for null in interval_tree_iter_first 2 years ago
iov.c util/iov: Do not assert offset is in iov 8 months ago
iova-tree.c vhost-iova-tree, svq: Implement GPA->IOVA & partial IOVA->HVA trees 9 months ago
keyval.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
lockcnt.c qemu-thread: Use futex if available for QemuLockCnt 5 months ago
log.c log: change qemu_loglevel to unsigned 2 months ago
main-loop.c timers: properly prefix init_clocks() 2 weeks ago
memalign.c osdep: Move memalign-related functions to their own header 4 years ago
memfd.c physmem: fd-based shared memory 10 months ago
meson.build qemu-thread: Use futex for QemuEvent on Windows 5 months ago
mmap-alloc.c util/mmap-alloc: qemu_fd_getfs() 3 years ago
module.c overall: Remove unnecessary g_strdup_printf() calls 9 months ago
notify.c notify: pass error to notifier with return 2 years ago
nvdimm-utils.c
osdep.c migration: Add direct-io parameter 1 year ago
oslib-posix.c oslib: qemu_clear_cloexec 1 month ago
oslib-win32.c oslib: qemu_clear_cloexec 1 month ago
path.c
qdist.c util: spelling fixes 2 years ago
qemu-co-shared-resource.c util/co-shared-resource: Remove unused co_try_get_from_shres 1 year ago
qemu-co-timeout.c util: add qemu-co-timeout 3 years ago
qemu-config.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
qemu-coroutine-io.c aio: remove aio_disable_external() API 3 years ago
qemu-coroutine-lock.c atomics: eliminate mb_read/mb_set 2 years ago
qemu-coroutine-sleep.c coroutine: Clean up superfluous inclusion of qemu/coroutine.h 3 years ago
qemu-coroutine.c util/coroutine: fix -Werror=maybe-uninitialized false-positive 1 year ago
qemu-option.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
qemu-print.c
qemu-progress.c include: move progress API to qemu-progress.h 4 years ago
qemu-sockets.c util/qemu-sockets: Introduce inet socket options controlling TCP keep-alive 6 months ago
qemu-thread-common.h bql: Fix bql_locked status with condvar APIs 2 weeks ago
qemu-thread-posix.c qemu-thread: Use futex for QemuEvent on Windows 5 months ago
qemu-thread-win32.c qemu-thread: Use futex for QemuEvent on Windows 5 months ago
qemu-timer-common.c
qemu-timer.c timers: properly prefix init_clocks() 2 weeks ago
qht.c cleanup: Drop pointless return at end of function 7 months ago
qsp.c system/cpus: rename qemu_mutex_lock_iothread() to bql_lock() 2 years ago
qtree.c tcg: use QTree instead of GTree 3 years ago
range.c util/range.c: spelling fix: inbetween 2 years ago
rcu.c rcu: Unify force quiescent state 3 weeks ago
readline.c util/readline: Add C-u shortcut 1 year ago
reserved-region.c util/reserved-region: Add new ReservedRegion helpers 2 years ago
s390x_pci_mmio.c util: Add functions for s390x mmio read/write 6 months ago
selfmap.c util/selfmap: Use dev_t and ino_t in MapInfo 2 years ago
stats64.c stat64: Add stat64_set() operation 3 years ago
sys_membarrier.c
systemd.c systemd: Also clear LISTEN_FDNAMES during systemd socket activation 3 years ago
thread-context.c qom: Make InterfaceInfo[] uses const 7 months ago
thread-pool.c thread-pool: Implement generic (non-AIO) pool support 8 months ago
throttle.c throttle: use THROTTLE_MAX/ARRAY_SIZE for hard code 2 years ago
timed-average.c license: Simplify GPL-2.0-or-later license descriptions 1 year ago
trace-events aio-posix: add aio_add_sqe() API for user-defined io_uring requests 4 days ago
trace.h
transactions.c transactions: Invoke clean() after everything else 4 years ago
unicode.c
userfaultfd.c util/userfaultfd: Remove unused uffd_poll_events 1 year ago
uuid.c util/uuid: Add UUID_STR_LEN definition 2 years ago
vfio-helpers.c include/system: Move exec/memory.h to system/memory.h 7 months ago
vhost-user-server.c util/vhost-user-server: vu_message_read(): improve error handling 2 months ago
yank.c qapi: Fix dangling references to docs/devel/qapi-code-gen.txt 2 years ago