On Thu, Apr 10, 2025 at 05:34:18PM +0200, Christoph Hellwig wrote: > On Thu, Apr 10, 2025 at 09:30:17PM +0800, Ming Lei wrote: > > @@ -5071,9 +4984,15 @@ static void __blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, > > blk_mq_debugfs_register_hctxs(q); > > } > > > > -switch_back: > > - list_for_each_entry(q, &set->tag_list, tag_set_list) > > - blk_mq_elv_switch_back(&head, q); > > + list_for_each_entry(q, &set->tag_list, tag_set_list) { > > + const char *name = "none"; > > + > > + mutex_lock(&q->elevator_lock); > > + if (q->elevator && !blk_queue_dying(q)) > > + name = q->elevator->type->elevator_name; > > + __elevator_change(q, name, true); > > + mutex_unlock(&q->elevator_lock); > > + } > > Coming back to this after looking through the next patches. > > Why do we even need the __elevator_change call here? We've not > actually disabled the elevator, and we prevent other callers > from changing it. > > As you pass in the force argument this now always calls > elevator_switch and thus blk_mq_init_sched. But why? sched tags is built over hctx and depends on ->nr_hw_queues, when nr_hw_queues is changed, sched tags has to be rebuilt. Thanks, Ming