Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io-wq: Drop intermediate step between pending list and active work

next_work is only used to make the work visible for
cancellation. Instead, we can just directly write to cur_work before
dropping the acct_lock and avoid the extra hop.

Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
Link: https://lore.kernel.org/r/20240416021054.3940-3-krisman@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Gabriel Krisman Bertazi and committed by
Jens Axboe
24c3fc5c 068c27e3

+2 -5
+2 -5
io_uring/io-wq.c
··· 51 51 struct io_wq *wq; 52 52 53 53 struct io_wq_work *cur_work; 54 - struct io_wq_work *next_work; 55 54 raw_spinlock_t lock; 56 55 57 56 struct completion ref_done; ··· 538 539 539 540 raw_spin_lock(&worker->lock); 540 541 worker->cur_work = work; 541 - worker->next_work = NULL; 542 542 raw_spin_unlock(&worker->lock); 543 543 } 544 544 ··· 571 573 * current work item for this worker. 572 574 */ 573 575 raw_spin_lock(&worker->lock); 574 - worker->next_work = work; 576 + worker->cur_work = work; 575 577 raw_spin_unlock(&worker->lock); 576 578 } 577 579 ··· 1006 1008 * may dereference the passed in work. 1007 1009 */ 1008 1010 raw_spin_lock(&worker->lock); 1009 - if (__io_wq_worker_cancel(worker, match, worker->cur_work) || 1010 - __io_wq_worker_cancel(worker, match, worker->next_work)) 1011 + if (__io_wq_worker_cancel(worker, match, worker->cur_work)) 1011 1012 match->nr_running++; 1012 1013 raw_spin_unlock(&worker->lock); 1013 1014