Skip to content

io_uring: add a CQ ring flag to enable/disable eventfd notification

Stefano Garzarella io-uring linux-fsdevel lkml 2 versions Applied

Status from this message: Thanks, applied.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyApplied
  2. v12 patches 5 repliesSuperseded

Changes in v2 from the cover letter

- changed the flag name and behaviour from IORING_CQ_NEED_EVENT to IORING_CQ_EVENTFD_DISABLED [Jens]

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2io_uring: add 'cq_flags' field for the CQ ringfs/io_uring.c include/uapi/linux/io_uring.h+12 -20 replies
2/2io_uring: add IORING_CQ_EVENTFD_DISABLED to the CQ ring flagsfs/io_uring.c include/uapi/linux/io_uring.h+9 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] io_uring: add a CQ ring flag to enable/disable eventfd notification

v1 -> v2:
- changed the flag name and behaviour from IORING_CQ_NEED_EVENT to IORING_CQ_EVENTFD_DISABLED [Jens]

The first patch adds the new 'cq_flags' field for the CQ ring. It should be written by the application and read by the kernel.

The second patch adds a new IORING_CQ_EVENTFD_DISABLED flag that can be used by the application to disable/enable eventfd notifications.

This feature can be useful if the application are using eventfd to be notified when requests are completed, but they don't want a notification for every request.
Of course the application can already remove the eventfd from the event loop, but as soon as it adds the eventfd again, it will be notified, even if it has already handled all the completed requests.

The most important use case is when the registered eventfd is used to notify a KVM guest through irqfd and we want a mechanism to enable/disable interrupts.

I also extended liburing API and added a test case here:
https://github.com/stefano-garzarella/liburing/tree/eventfd-disable

Stefano Garzarella (2):
io_uring: add 'cq_flags' field for the CQ ring
io_uring: add IORING_CQ_EVENTFD_DISABLED to the CQ ring flags

 fs/io_uring.c                 | 12 +++++++++++-
 include/uapi/linux/io_uring.h | 11 ++++++++++-
 2 files changed, 21 insertions(+), 2 deletions(-)
Signature · 1 line
2.25.4