linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V4 00/24] block: unify elevator changing and fix lockdep warning
@ 2025-04-30  4:35 Ming Lei
  2025-04-30  4:35 ` [PATCH V4 01/24] block: move blk_mq_add_queue_tag_set() after blk_mq_map_swqueue() Ming Lei
                   ` (24 more replies)
  0 siblings, 25 replies; 51+ messages in thread
From: Ming Lei @ 2025-04-30  4:35 UTC (permalink / raw)
  To: Jens Axboe, linux-block
  Cc: Nilay Shroff, Shinichiro Kawasaki, Thomas Hellström,
	Christoph Hellwig, Ming Lei

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,
Ming

V4:
	- pull Christoph's two elevator change/switch cleanup patches first,
	then the following elevator change unifying is simplified a lot(Christoph)

	- fold Nilay's patch into the last patch for avoiding one new
	lock warning on rqos_state_mutex (Nilay Shoff)

	- drop patch "block: move blk_unregister_queue() & device_del() after freeze
	wait" which may cause MD hang during shutdown, and add new patch "block: add
    new helper for disabling elevator switch when deleting disk" for dealing with
    one small race window (Christoph)

	- add patch "block: remove elevator queue's type check in elv_attr_show/store()"
	(Christoph)

    - rename ->update_nr_hwq_sema as ->update_nr_hwq_lock (Christoph)

	- add small patch "block: move blk_queue_registered() check into elv_iosched_store()"

V3:
	- replace srcu with rw_sem for avoiding race between add/del disk &
	  elevator switch and updating nr_hw_queues (Nilay Shoff)

	- add elv_update_nr_hw_queues() for elevator reattachment in case of
	updating nr_hw_queues, meantime keep elv_change_ctx as local structure
	(Christoph)

	- replace ->elevator_lock with disk->rqos_state_mutex for covering wbt
	state change

	- add new patch "block: use q->elevator with ->elevator_lock held in elv_iosched_show()"

	- small cleanup & commit log improvement

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)

Christoph Hellwig (2):
  block: look up the elevator type in elevator_switch
  block: fold elevator_disable into elevator_switch

Ming Lei (22):
  block: move blk_mq_add_queue_tag_set() after blk_mq_map_swqueue()
  block: move ELEVATOR_FLAG_DISABLE_WBT a request queue flag
  block: don't call freeze queue in elevator_switch() and
    elevator_disable()
  block: use q->elevator with ->elevator_lock held in elv_iosched_show()
  block: add two helpers for registering/un-registering sched debugfs
  block: move sched debugfs register into elvevator_register_queue
  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: move blk_queue_registered() check into elv_iosched_store()
  block: simplify elevator reattachment for updating nr_hw_queues
  block: move queue freezing & elevator_lock into elevator_change()
  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: remove elevator queue's type check in elv_attr_show/store()
  block: fail to show/store elevator sysfs attribute if elevator is
    dying
  block: add new helper for disabling elevator switch when deleting disk
  block: move elv_register[unregister]_queue out of elevator_lock
  block: move hctx debugfs/sysfs registering out of freezing queue
  block: don't acquire ->elevator_lock in blk_mq_map_swqueue and
    blk_mq_realloc_hw_ctxs
  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 |  13 +-
 block/blk-mq-sched.c   |  41 ++++--
 block/blk-mq.c         | 132 +++--------------
 block/blk-sysfs.c      |  29 ++--
 block/blk-wbt.c        |   9 +-
 block/blk.h            |   8 +-
 block/elevator.c       | 322 ++++++++++++++++++++++++-----------------
 block/elevator.h       |   6 +-
 block/genhd.c          | 151 ++++++++++++-------
 include/linux/blk-mq.h |   3 +
 include/linux/blkdev.h |   8 +
 12 files changed, 369 insertions(+), 359 deletions(-)

-- 
2.47.0


^ permalink raw reply	[flat|nested] 51+ messages in thread

end of thread, other threads:[~2025-05-02 12:50 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-30  4:35 [PATCH V4 00/24] block: unify elevator changing and fix lockdep warning Ming Lei
2025-04-30  4:35 ` [PATCH V4 01/24] block: move blk_mq_add_queue_tag_set() after blk_mq_map_swqueue() Ming Lei
2025-04-30  4:35 ` [PATCH V4 02/24] block: move ELEVATOR_FLAG_DISABLE_WBT a request queue flag Ming Lei
2025-04-30  4:35 ` [PATCH V4 03/24] block: don't call freeze queue in elevator_switch() and elevator_disable() Ming Lei
2025-04-30  4:35 ` [PATCH V4 04/24] block: use q->elevator with ->elevator_lock held in elv_iosched_show() Ming Lei
2025-04-30  4:35 ` [PATCH V4 05/24] block: add two helpers for registering/un-registering sched debugfs Ming Lei
2025-04-30  4:35 ` [PATCH V4 06/24] block: move sched debugfs register into elvevator_register_queue Ming Lei
2025-04-30  4:35 ` [PATCH V4 07/24] block: prevent adding/deleting disk during updating nr_hw_queues Ming Lei
2025-04-30  4:35 ` [PATCH V4 08/24] block: don't allow to switch elevator if updating nr_hw_queues is in-progress Ming Lei
2025-04-30 14:09   ` Christoph Hellwig
2025-04-30  4:35 ` [PATCH V4 09/24] block: look up the elevator type in elevator_switch Ming Lei
2025-04-30  6:14   ` Hannes Reinecke
2025-05-01  6:47   ` Nilay Shroff
2025-04-30  4:35 ` [PATCH V4 10/24] block: fold elevator_disable into elevator_switch Ming Lei
2025-04-30  6:14   ` Hannes Reinecke
2025-05-01  6:59   ` Nilay Shroff
2025-04-30  4:35 ` [PATCH V4 11/24] block: move blk_queue_registered() check into elv_iosched_store() Ming Lei
2025-04-30  6:15   ` Hannes Reinecke
2025-05-01  9:55   ` Nilay Shroff
2025-05-02 12:46     ` Ming Lei
2025-04-30  4:35 ` [PATCH V4 12/24] block: simplify elevator reattachment for updating nr_hw_queues Ming Lei
2025-04-30  4:35 ` [PATCH V4 13/24] block: move queue freezing & elevator_lock into elevator_change() Ming Lei
2025-04-30 14:13   ` Christoph Hellwig
2025-04-30  4:35 ` [PATCH V4 14/24] block: add `struct elv_change_ctx` for unifying elevator change Ming Lei
2025-04-30 14:15   ` Christoph Hellwig
2025-04-30  4:35 ` [PATCH V4 15/24] block: " Ming Lei
2025-04-30 14:17   ` Christoph Hellwig
2025-05-01 10:28   ` Nilay Shroff
2025-04-30  4:35 ` [PATCH V4 16/24] block: pass elevator_queue to elv_register_queue & unregister_queue Ming Lei
2025-04-30 14:18   ` Christoph Hellwig
2025-04-30  4:35 ` [PATCH V4 17/24] block: remove elevator queue's type check in elv_attr_show/store() Ming Lei
2025-04-30  6:16   ` Hannes Reinecke
2025-04-30 14:18   ` Christoph Hellwig
2025-05-01 10:31   ` Nilay Shroff
2025-04-30  4:35 ` [PATCH V4 18/24] block: fail to show/store elevator sysfs attribute if elevator is dying Ming Lei
2025-04-30  6:31   ` Hannes Reinecke
2025-04-30 13:30     ` Ming Lei
2025-04-30 14:19   ` Christoph Hellwig
2025-04-30  4:35 ` [PATCH V4 19/24] block: add new helper for disabling elevator switch when deleting disk Ming Lei
2025-04-30  6:32   ` Hannes Reinecke
2025-04-30 14:20   ` Christoph Hellwig
2025-04-30  4:35 ` [PATCH V4 20/24] block: move elv_register[unregister]_queue out of elevator_lock Ming Lei
2025-05-01 10:26   ` Nilay Shroff
2025-05-02 12:50     ` Ming Lei
2025-04-30  4:35 ` [PATCH V4 21/24] block: move hctx debugfs/sysfs registering out of freezing queue Ming Lei
2025-04-30  4:35 ` [PATCH V4 22/24] block: don't acquire ->elevator_lock in blk_mq_map_swqueue and blk_mq_realloc_hw_ctxs Ming Lei
2025-04-30  4:35 ` [PATCH V4 23/24] block: move hctx cpuhp add/del out of queue freezing Ming Lei
2025-04-30  4:35 ` [PATCH V4 24/24] block: move wbt_enable_default() out of queue freezing from sched ->exit() Ming Lei
2025-04-30  6:33   ` Hannes Reinecke
2025-04-30 14:08 ` [PATCH V4 00/24] block: unify elevator changing and fix lockdep warning Christoph Hellwig
2025-04-30 14:13   ` Ming Lei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).