From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 4/4] io_uring: remove extra in_idle wake up
Date: Mon, 1 Mar 2021 18:20:48 +0000 [thread overview]
Message-ID: <ec4616bacc4f4928eb34fe64ef162978eacbd62f.1614622683.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>
io_dismantle_req() is always followed by io_put_task(), which already do
proper in_idle wake ups, so we can skip waking the owner task in
io_dismantle_req(). The rules are simpler now, do io_put_task() shortly
after ending a request, and it will be fine.
Signed-off-by: Pavel Begunkov <[email protected]>
---
fs/io_uring.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 411323dc43bb..e9215477426d 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1649,18 +1649,16 @@ static void io_dismantle_req(struct io_kiocb *req)
if (req->flags & REQ_F_INFLIGHT) {
struct io_ring_ctx *ctx = req->ctx;
- struct io_uring_task *tctx = req->task->io_uring;
unsigned long flags;
spin_lock_irqsave(&ctx->inflight_lock, flags);
list_del(&req->inflight_entry);
spin_unlock_irqrestore(&ctx->inflight_lock, flags);
req->flags &= ~REQ_F_INFLIGHT;
- if (atomic_read(&tctx->in_idle))
- wake_up(&tctx->wait);
}
}
+/* must to be called somewhat shortly after putting a request */
static inline void io_put_task(struct task_struct *task, int nr)
{
struct io_uring_task *tctx = task->io_uring;
--
2.24.0
next prev parent reply other threads:[~2021-03-01 18:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-01 18:20 [PATCH 5.12 0/4] random 5.12 bits Pavel Begunkov
2021-03-01 18:20 ` [PATCH 1/4] io_uring: choose right tctx->io_wq for try cancel Pavel Begunkov
2021-03-01 18:20 ` [PATCH 2/4] io_uring: inline io_req_clean_work() Pavel Begunkov
2021-03-01 18:20 ` [PATCH 3/4] io_uring: inline __io_queue_async_work() Pavel Begunkov
2021-03-01 18:20 ` Pavel Begunkov [this message]
2021-03-01 23:41 ` [PATCH 5.12 0/4] random 5.12 bits Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ec4616bacc4f4928eb34fe64ef162978eacbd62f.1614622683.git.asml.silence@gmail.com \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox