Commit 1cbd9c2b authored by Jens Axboe's avatar Jens Axboe

io-wq: don't create any IO workers upfront

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: default avatarJens Axboe <axboe@kernel.dk>
parent 7c25c0d1
...@@ -759,18 +759,7 @@ static int io_wq_manager(void *data) ...@@ -759,18 +759,7 @@ static int io_wq_manager(void *data)
struct io_wq *wq = data; struct io_wq *wq = data;
int node; int node;
/* create fixed workers */
refcount_set(&wq->refs, 1); 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); complete(&wq->done);
while (!kthread_should_stop()) { while (!kthread_should_stop()) {
...@@ -796,7 +785,6 @@ static int io_wq_manager(void *data) ...@@ -796,7 +785,6 @@ static int io_wq_manager(void *data)
schedule_timeout(HZ); schedule_timeout(HZ);
} }
out:
if (refcount_dec_and_test(&wq->refs)) { if (refcount_dec_and_test(&wq->refs)) {
complete(&wq->done); complete(&wq->done);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment