]> www.infradead.org Git - users/willy/linux.git/commitdiff
io_uring: remove IO_WQ_WORK_CB
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 28 Feb 2020 07:36:38 +0000 (10:36 +0300)
committerJens Axboe <axboe@kernel.dk>
Mon, 2 Mar 2020 21:06:29 +0000 (14:06 -0700)
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 <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io-wq.c
fs/io-wq.h
fs/io_uring.c

index 39ed8751ea31d82c957a47c279142e0bd50536d2..a1a42ead3b5a663c8916349850ad682f4d2ed7e7 100644 (file)
@@ -479,9 +479,6 @@ next:
                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;
index d500d88ab84e5582e318ee4cae090a9d69d95dde..a0978d6958f0391cd434f3303a0547cce7d9f32b 100644 (file)
@@ -7,7 +7,6 @@ enum {
        IO_WQ_WORK_CANCEL       = 1,
        IO_WQ_WORK_HASHED       = 4,
        IO_WQ_WORK_UNBOUND      = 32,
-       IO_WQ_WORK_CB           = 128,
        IO_WQ_WORK_NO_CANCEL    = 256,
        IO_WQ_WORK_CONCURRENT   = 512,
 
index 2a8d88c9bcab17e708c2884c7f90f306c5fa0ec2..f999503854b77c9900d6653e2f79d9d10bbcfbde 100644 (file)
@@ -2549,7 +2549,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)
@@ -2559,7 +2559,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;
        }