Skip to content

Commit d416c92

Browse files
fshh520axboe
authored andcommitted
blk-mq: clear hctx->dispatch_from when mappings change
When the number of hardware queues is changed, the drivers will call blk_mq_update_nr_hw_queues() to remap hardware queues. This changes the ctx mappings, but the current code doesn't clear the ->dispatch_from hint. This can result in dispatch_from pointing to a ctx that isn't mapped to the hctx anymore. Fixes: b347689 ("blk-mq-sched: improve dispatching from sw queue") Signed-off-by: huhai <[email protected]> Reviewed-by: Ming Lei <[email protected]> Moved the placement of the clearing to where we clear other items pertaining to the existing mapping, added Fixes line, and reworded the commit message. Signed-off-by: Jens Axboe <[email protected]>
1 parent 76aa1d3 commit d416c92

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

block/blk-mq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2358,6 +2358,7 @@ static void blk_mq_map_swqueue(struct request_queue *q)
23582358
queue_for_each_hw_ctx(q, hctx, i) {
23592359
cpumask_clear(hctx->cpumask);
23602360
hctx->nr_ctx = 0;
2361+
hctx->dispatch_from = NULL;
23612362
}
23622363

23632364
/*

0 commit comments

Comments
 (0)