[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200116134946.184711-1-sgarzare@redhat.com>
Date: Thu, 16 Jan 2020 14:49:46 +0100
From: Stefano Garzarella <sgarzare@...hat.com>
To: Jens Axboe <axboe@...nel.dk>
Cc: Alexander Viro <viro@...iv.linux.org.uk>, io-uring@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: [PATCH] io_uring: wakeup threads waiting for EPOLLOUT events
io_uring_poll() sets EPOLLOUT flag if there is space in the
SQ ring, then we should wakeup threads waiting for EPOLLOUT
events when we expose the new SQ head to the userspace.
Signed-off-by: Stefano Garzarella <sgarzare@...hat.com>
---
Do you think is better to change the name of 'cq_wait' and 'cq_fasync'?
Thanks,
Stefano
---
fs/io_uring.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 38b54051facd..5c6ff5f9e741 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -3687,6 +3687,11 @@ static void io_commit_sqring(struct io_ring_ctx *ctx)
* write new data to them.
*/
smp_store_release(&rings->sq.head, ctx->cached_sq_head);
+
+ if (wq_has_sleeper(&ctx->cq_wait)) {
+ wake_up_interruptible(&ctx->cq_wait);
+ kill_fasync(&ctx->cq_fasync, SIGIO, POLL_OUT);
+ }
}
}
--
2.24.1
Powered by blists - more mailing lists