Skip to content

Commit b089ed3

Browse files
isilenceaxboe
authored andcommitted
io-wq: update hash bits
Linked requests are hashed, remove a comment stating otherwise. Also move hash bits to emphasise that we don't carry it through loop iteration and set it every time. Signed-off-by: Pavel Begunkov <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent f063c54 commit b089ed3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

fs/io-wq.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,6 @@ static void io_worker_handle_work(struct io_worker *worker)
490490

491491
do {
492492
struct io_wq_work *work;
493-
unsigned int hash;
494493
get_next:
495494
/*
496495
* If we got some work, mark us as busy. If we didn't, but
@@ -513,6 +512,7 @@ static void io_worker_handle_work(struct io_worker *worker)
513512
/* handle a whole dependent link */
514513
do {
515514
struct io_wq_work *old_work, *next_hashed, *linked;
515+
unsigned int hash = io_get_work_hash(work);
516516

517517
next_hashed = wq_next_work(work);
518518
io_impersonate_work(worker, work);
@@ -523,7 +523,6 @@ static void io_worker_handle_work(struct io_worker *worker)
523523
if (test_bit(IO_WQ_BIT_CANCEL, &wq->state))
524524
work->flags |= IO_WQ_WORK_CANCEL;
525525

526-
hash = io_get_work_hash(work);
527526
old_work = work;
528527
linked = wq->do_work(work);
529528

@@ -542,8 +541,6 @@ static void io_worker_handle_work(struct io_worker *worker)
542541
spin_lock_irq(&wqe->lock);
543542
wqe->hash_map &= ~BIT_ULL(hash);
544543
wqe->flags &= ~IO_WQE_FLAG_STALLED;
545-
/* dependent work is not hashed */
546-
hash = -1U;
547544
/* skip unnecessary unlock-lock wqe->lock */
548545
if (!work)
549546
goto get_next;

0 commit comments

Comments
 (0)