mbox series

[V2,00/20] block: unify elevator changing and fix lockdep warning

Message ID 20250418163708.442085-1-ming.lei@redhat.com (mailing list archive)
Headers show
Series block: unify elevator changing and fix lockdep warning | expand

Message

Ming Lei April 18, 2025, 4:36 p.m. UTC
Hello Jens,

This patchset cleans up elevator change code, and unifying it via single
helper, meantime moves kobject_add/del & debugfs register/unregister out of
queue freezing & elevator_lock. This way fixes many lockdep warnings
reported recently, especially since fs_reclaim is connected with freeze lock
manually by commit ffa1e7ada456 ("block: Make request_queue lockdep splats
show up earlier").


Thanks,

V2:
	- retry add/del disk when blk_mq_update_nr_hw_queues() is in-progress

	- swap blk_mq_add_queue_tag_set() with blk_mq_map_swqueue() in
	blk_mq_init_allocated_queue() (Nilay Shroff)

	- move ELEVATOR_FLAG_DISABLE_WBT to request queue's flags (Nilay Shoff) 

	- fix race because of delaying elevator unregister

	- define flags of `elv_change_ctx` as `bool` (Christoph)

	- improve comment and commit log (Christoph)

Ming Lei (20):
  block: move blk_mq_add_queue_tag_set() after blk_mq_map_swqueue()
  block: move ELEVATOR_FLAG_DISABLE_WBT as request queue flag
  block: don't call freeze queue in elevator_switch() and
    elevator_disable()
  block: add two helpers for registering/un-registering sched debugfs
  block: move sched debugfs register into elvevator_register_queue
  block: add & pass 'struct gendisk_data' for retrying add/del disk in
    updating nr_hw_queues
  block: prevent adding/deleting disk during updating nr_hw_queues
  block: don't allow to switch elevator if updating nr_hw_queues is
    in-progress
  block: simplify elevator rebuild for updating nr_hw_queues
  block: add helper of elevator_change()
  block: move blk_unregister_queue() & device_del() after freeze wait
  block: add `struct elv_change_ctx` for unifying elevator_change
  block: unifying elevator change
  block: pass elevator_queue to elv_register_queue & unregister_queue
  block: fail to show/store elevator sysfs attribute if elevator is
    dying
  block: move elv_register[unregister]_queue out of elevator_lock
  block: move debugfs/sysfs register out of freezing queue
  block: remove several ->elevator_lock
  block: move hctx cpuhp add/del out of queue freezing
  block: move wbt_enable_default() out of queue freezing from sched
    ->exit()

 block/bfq-iosched.c    |   6 +-
 block/blk-mq-debugfs.c |  12 +--
 block/blk-mq-sched.c   |  41 +++++---
 block/blk-mq.c         | 172 ++++++++++--------------------
 block/blk-sysfs.c      |  18 ++--
 block/blk-wbt.c        |   3 +-
 block/blk.h            |  10 +-
 block/elevator.c       | 231 +++++++++++++++++++++++++++--------------
 block/elevator.h       |  19 +++-
 block/genhd.c          | 158 +++++++++++++++++-----------
 include/linux/blk-mq.h |   5 +
 include/linux/blkdev.h |   3 +
 12 files changed, 374 insertions(+), 304 deletions(-)