Skip to content

Commit

Permalink
io-wq: remove unused io-wq refcounting
Browse files Browse the repository at this point in the history
iowq->refs is initialised to one and killed on exit, so it's not used
and we can kill it.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/401007393528ea7c102360e69a29b64498e15db2.1623634181.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Pavel Begunkov authored and Jens Axboe committed Jun 14, 2021
1 parent c7f405d commit 382cb03
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions fs/io-wq.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ struct io_wq {

struct io_wq_hash *hash;

refcount_t refs;

atomic_t worker_refs;
struct completion worker_done;

Expand Down Expand Up @@ -949,7 +947,6 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data)
}

wq->task = get_task_struct(data->task);
refcount_set(&wq->refs, 1);
atomic_set(&wq->worker_refs, 1);
init_completion(&wq->worker_done);
return wq;
Expand Down Expand Up @@ -1038,8 +1035,7 @@ void io_wq_put_and_exit(struct io_wq *wq)
WARN_ON_ONCE(!test_bit(IO_WQ_BIT_EXIT, &wq->state));

io_wq_exit_workers(wq);
if (refcount_dec_and_test(&wq->refs))
io_wq_destroy(wq);
io_wq_destroy(wq);
}

static bool io_wq_worker_affinity(struct io_worker *worker, void *data)
Expand Down

0 comments on commit 382cb03

Please sign in to comment.