io-wq: don't create any IO workers upfront
authorJens Axboe <axboe@kernel.dk>
Tue, 16 Feb 2021 17:06:21 +0000 (10:06 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 22 Feb 2021 00:25:22 +0000 (17:25 -0700)
When the manager thread starts up, it creates a worker per node for
the given context. Just let these get created dynamically, like we do
for adding further workers.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io-wq.c

index 800b299..e9e2182 100644 (file)
@@ -759,18 +759,7 @@ static int io_wq_manager(void *data)
        struct io_wq *wq = data;
        int node;
 
-       /* create fixed workers */
        refcount_set(&wq->refs, 1);
-       for_each_node(node) {
-               if (!node_online(node))
-                       continue;
-               if (create_io_worker(wq, wq->wqes[node], IO_WQ_ACCT_BOUND))
-                       continue;
-               set_bit(IO_WQ_BIT_ERROR, &wq->state);
-               set_bit(IO_WQ_BIT_EXIT, &wq->state);
-               goto out;
-       }
-
        complete(&wq->done);
 
        while (!kthread_should_stop()) {
@@ -796,7 +785,6 @@ static int io_wq_manager(void *data)
                schedule_timeout(HZ);
        }
 
-out:
        if (refcount_dec_and_test(&wq->refs)) {
                complete(&wq->done);
                return 0;