Skip to content

[IO] overhaul SQPOLL support

Maxim Onciul requested to merge sqpoll into master

Two meson options control the io_uring sqpoll feature:

  • io_uring_sqpoll - enable sq polling
  • io_uring_shared_poller - share the polling thread between all io_urings

Since 5.12 the IORING_SETUP_ATTACH_WQ only causes sharing of poller threads not the work queues. See: https://github.com/axboe/liburing/issues/349

When using SQPOLL the userspace has no good way to know how many sqes the kernmel has consumed therefore we wait for available sqes using io_uring_sqring_wait if there was no usable sqe.

Remove the GlobalIoContext::registerLock and register all worker io_uring eventfd reads at the beginning of the completer function. Also register all the worker io_uring eventfds since they never change and it hopefully reduces overhead in the global io_uring.

When 5.15 is released with the fix failed linkchain logic path the kernel will consume the whole broken chain and we don't need to manually invalidate not submitted sqes. This allows SQPOLL to work for invalid chains.

Needs !248 (merged) and at least linux 5.15.

Edited by Maxim Onciul

Merge request reports

Loading