summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorStefano Garzarella <sgarzare@redhat.com>2020-05-15 18:38:05 +0200
committerJens Axboe <axboe@kernel.dk>2020-05-15 12:16:59 -0600
commit7e55a19cf6e70ce08964b46dbbfbdb07fbc995fc (patch)
treec3c822bc6a855e22fa9d1092f7670eb4a1b59274 /fs/io_uring.c
parent0d9b5b3af134cddfdc1dd31d41946a0ad389bbf2 (diff)
downloadlwn-7e55a19cf6e70ce08964b46dbbfbdb07fbc995fc.tar.gz
lwn-7e55a19cf6e70ce08964b46dbbfbdb07fbc995fc.zip
io_uring: add IORING_CQ_EVENTFD_DISABLED to the CQ ring flags
This new flag should be set/clear from the application to disable/enable eventfd notifications when a request is completed and queued to the CQ ring. Before this patch, notifications were always sent if an eventfd is registered, so IORING_CQ_EVENTFD_DISABLED is not set during the initialization. It will be up to the application to set the flag after initialization if no notifications are required at the beginning. Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 02250693a406..f800b0b4498f 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1153,6 +1153,8 @@ static inline bool io_should_trigger_evfd(struct io_ring_ctx *ctx)
{
if (!ctx->cq_ev_fd)
return false;
+ if (READ_ONCE(ctx->rings->cq_flags) & IORING_CQ_EVENTFD_DISABLED)
+ return false;
if (!ctx->eventfd_async)
return true;
return io_wq_current_is_worker();