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.

block: fix elv_update_nr_hw_queues() to reattach elevator

When nr_hw_queues is updated, the elevator needs to be switched to
ensure that we exit elevator and reattach it to ensure that hctx->
sched_tags is correctly allocated for the new hardware queues.
However, elv_update_nr_hw_queues() currently only switches the
elevator if the queue is not registered. This is incorrect, as it
prevents reattaching the elevator after updating nr_hw_queues, which
in turn inhibits allocation of sched_tags.

Fix this by allowing the elevator switch if the queue is registered,
ensuring proper reattachment and resource allocation.

Fixes: 596dce110b7d ("block: simplify elevator reattachment for updating nr_hw_queues")
Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
Link: https://lore.kernel.org/r/20250515134511.548270-1-nilay@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Nilay Shroff and committed by
Jens Axboe
532b9e11 dbc5ba08

+1 -1
+1 -1
block/elevator.c
··· 697 697 WARN_ON_ONCE(q->mq_freeze_depth == 0); 698 698 699 699 mutex_lock(&q->elevator_lock); 700 - if (q->elevator && !blk_queue_dying(q) && !blk_queue_registered(q)) { 700 + if (q->elevator && !blk_queue_dying(q) && blk_queue_registered(q)) { 701 701 ctx.name = q->elevator->type->elevator_name; 702 702 703 703 /* force to reattach elevator after nr_hw_queue is updated */