From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 4/5] io_uring: remove IO_WQ_WORK_CB
Date: Fri, 28 Feb 2020 10:36:38 +0300 [thread overview]
Message-ID: <177e3005d8ae1548eda877e9c942a613aa08b32c.1582874853.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>
IO_WQ_WORK_CB is used only for linked timeouts, which will be armed
before the work setup (i.e. mm, override creds, etc). The setup
shouldn't take long, so it's ok to arm it a bit later and get rid
of IO_WQ_WORK_CB.
Make io-wq call work->func() only once, callbacks will handle the rest.
i.e. the linked timeout handler will do the actual issue. And as a
bonus, it removes an extra indirect call.
Signed-off-by: Pavel Begunkov <[email protected]>
---
fs/io-wq.c | 3 ---
fs/io-wq.h | 1 -
fs/io_uring.c | 3 +--
3 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/fs/io-wq.c b/fs/io-wq.c
index 72c73c7b7f28..1ceb12c58ae6 100644
--- a/fs/io-wq.c
+++ b/fs/io-wq.c
@@ -479,9 +479,6 @@ static void io_worker_handle_work(struct io_worker *worker)
worker->cur_work = work;
spin_unlock_irq(&worker->lock);
- if (work->flags & IO_WQ_WORK_CB)
- work->func(&work);
-
if (work->files && current->files != work->files) {
task_lock(current);
current->files = work->files;
diff --git a/fs/io-wq.h b/fs/io-wq.h
index 72c860f477d2..001194aef6ae 100644
--- a/fs/io-wq.h
+++ b/fs/io-wq.h
@@ -8,7 +8,6 @@ enum {
IO_WQ_WORK_HASHED = 4,
IO_WQ_WORK_UNBOUND = 32,
IO_WQ_WORK_INTERNAL = 64,
- IO_WQ_WORK_CB = 128,
IO_WQ_WORK_NO_CANCEL = 256,
IO_WQ_WORK_CONCURRENT = 512,
diff --git a/fs/io_uring.c b/fs/io_uring.c
index a32a195407ac..f5fbde552be7 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2554,7 +2554,7 @@ static void io_link_work_cb(struct io_wq_work **workptr)
struct io_kiocb *link = work->data;
io_queue_linked_timeout(link);
- work->func = io_wq_submit_work;
+ io_wq_submit_work(workptr);
}
static void io_wq_assign_next(struct io_wq_work **workptr, struct io_kiocb *nxt)
@@ -2564,7 +2564,6 @@ static void io_wq_assign_next(struct io_wq_work **workptr, struct io_kiocb *nxt)
io_prep_next_work(nxt, &link);
*workptr = &nxt->work;
if (link) {
- nxt->work.flags |= IO_WQ_WORK_CB;
nxt->work.func = io_link_work_cb;
nxt->work.data = link;
}
--
2.24.0
next prev parent reply other threads:[~2020-02-28 7:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-28 7:36 [PATCH 0/5] random io-wq and io_uring bits Pavel Begunkov
2020-02-28 7:36 ` [PATCH 1/5] io_uring: clean io_poll_complete Pavel Begunkov
2020-02-28 7:36 ` [PATCH 2/5] io_uring: extract kmsg copy helper Pavel Begunkov
2020-02-28 7:36 ` [PATCH 3/5] io-wq: remove unused IO_WQ_WORK_HAS_MM Pavel Begunkov
2020-02-28 7:36 ` Pavel Begunkov [this message]
2020-02-28 7:36 ` [PATCH 5/5] io-wq: use BIT for ulong hash Pavel Begunkov
2020-02-28 14:07 ` [PATCH 0/5] random io-wq and io_uring bits Jens Axboe
2020-02-28 14:26 ` 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=177e3005d8ae1548eda877e9c942a613aa08b32c.1582874853.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