Skip to content

Commit 382cb03

Browse files
isilenceaxboe
authored andcommitted
io-wq: remove unused io-wq refcounting
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 <[email protected]> Link: https://lore.kernel.org/r/401007393528ea7c102360e69a29b64498e15db2.1623634181.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent c7f405d commit 382cb03

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

fs/io-wq.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ struct io_wq {
109109

110110
struct io_wq_hash *hash;
111111

112-
refcount_t refs;
113-
114112
atomic_t worker_refs;
115113
struct completion worker_done;
116114

@@ -949,7 +947,6 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data)
949947
}
950948

951949
wq->task = get_task_struct(data->task);
952-
refcount_set(&wq->refs, 1);
953950
atomic_set(&wq->worker_refs, 1);
954951
init_completion(&wq->worker_done);
955952
return wq;
@@ -1038,8 +1035,7 @@ void io_wq_put_and_exit(struct io_wq *wq)
10381035
WARN_ON_ONCE(!test_bit(IO_WQ_BIT_EXIT, &wq->state));
10391036

10401037
io_wq_exit_workers(wq);
1041-
if (refcount_dec_and_test(&wq->refs))
1042-
io_wq_destroy(wq);
1038+
io_wq_destroy(wq);
10431039
}
10441040

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

0 commit comments

Comments
 (0)