If we have someone potentially waiting for tracked requests to finish, ensure that we check in_idle and wake them up appropriately.
Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe axboe@kernel.dk --- fs/io_uring.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/fs/io_uring.c b/fs/io_uring.c index c4f217613f56..b4d5b8d168bf 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -6640,6 +6640,8 @@ static void io_clean_op(struct io_kiocb *req) struct io_uring_task *tctx = req->task->io_uring;
atomic_dec(&tctx->inflight_tracked); + if (unlikely(atomic_read(&tctx->in_idle))) + wake_up(&tctx->wait); } if (req->flags & REQ_F_CREDS) put_cred(req->creds);
在 2021/12/9 下午11:59, Jens Axboe 写道:
If we have someone potentially waiting for tracked requests to finish, ensure that we check in_idle and wake them up appropriately.
Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe axboe@kernel.dk
Hi Jens,
I saw every/several( in batching cases) io_clean_op() followed by an io_put_task() which does the same thing
as this patch, so it seems this one is not neccessary? Correct me if I'm wrong since I haven't touch this code for
a long time.
Regards, Hao
fs/io_uring.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/fs/io_uring.c b/fs/io_uring.c index c4f217613f56..b4d5b8d168bf 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -6640,6 +6640,8 @@ static void io_clean_op(struct io_kiocb *req) struct io_uring_task *tctx = req->task->io_uring; atomic_dec(&tctx->inflight_tracked);
if (unlikely(atomic_read(&tctx->in_idle)))
} if (req->flags & REQ_F_CREDS) put_cred(req->creds);wake_up(&tctx->wait);
On 12/10/21 12:21 AM, Hao Xu wrote:
在 2021/12/9 下午11:59, Jens Axboe 写道:
If we have someone potentially waiting for tracked requests to finish, ensure that we check in_idle and wake them up appropriately.
Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe axboe@kernel.dk
Hi Jens,
I saw every/several( in batching cases) io_clean_op() followed by an io_put_task() which does the same thing
as this patch, so it seems this one is not neccessary? Correct me if I'm wrong since I haven't touch this code for
Hard to deduce as it also depends on whether it's the task itself or not. Making it explicit is better imho.
linux-stable-mirror@lists.linaro.org