Skip to content

Commit

Permalink
io-wq: worker idling always returns false
Browse files Browse the repository at this point in the history
Remove the bool return, and the checking for it in the caller.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Jens Axboe committed Feb 22, 2021
1 parent 3bfe610 commit c6d77d9
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions fs/io-wq.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,13 @@ static void __io_worker_busy(struct io_wqe *wqe, struct io_worker *worker,
* retry the loop in that case (we changed task state), we don't regrab
* the lock if we return success.
*/
static bool __io_worker_idle(struct io_wqe *wqe, struct io_worker *worker)
static void __io_worker_idle(struct io_wqe *wqe, struct io_worker *worker)
__must_hold(wqe->lock)
{
if (!(worker->flags & IO_WORKER_F_FREE)) {
worker->flags |= IO_WORKER_F_FREE;
hlist_nulls_add_head_rcu(&worker->nulls_node, &wqe->free_list);
}

return false;
}

static inline unsigned int io_get_work_hash(struct io_wq_work *work)
Expand Down Expand Up @@ -454,11 +452,7 @@ static int io_wqe_worker(void *data)
io_worker_handle_work(worker);
goto loop;
}
/* drops the lock on success, retry */
if (__io_worker_idle(wqe, worker)) {
__release(&wqe->lock);
goto loop;
}
__io_worker_idle(wqe, worker);
raw_spin_unlock_irq(&wqe->lock);
io_flush_signals();
if (schedule_timeout(WORKER_IDLE_TIMEOUT))
Expand Down

0 comments on commit c6d77d9

Please sign in to comment.