Linux block layer
 help / color / mirror / Atom feed
* [PATCH 0/5] blk-mq: Replace tags->lock with SRCU for tag iterators
@ 2025-08-01 11:44 Ming Lei
  2025-08-01 11:44 ` [PATCH 1/5] blk-mq: Move flush queue allocation into blk_mq_init_hctx() Ming Lei
                   ` (4 more replies)
  0 siblings, 5 replies; 30+ messages in thread
From: Ming Lei @ 2025-08-01 11:44 UTC (permalink / raw)
  To: Jens Axboe, linux-block
  Cc: Yu Kuai, John Garry, Sathya Prakash Veerichetty, Ming Lei

Hello Jens,

Replace the spinlock in blk_mq_find_and_get_req() with an SRCU read lock
around the tag iterators.

Avoids scsi_host_busy() lockup during scsi host blocked  in case of big cpu
cores & deep queue depth.

Also it becomes possible to use blk_mq_in_driver_rw() for io accounting now.

Take the following approach:

- clearing rq reference in tags->rqs[] and deferring freeing scheduler requests
in SRCU callback

- replace tags->lock with srcu read lock in tags iterator.


Ming Lei (5):
  blk-mq: Move flush queue allocation into blk_mq_init_hctx()
  blk-mq: Pass tag_set to blk_mq_free_rq_map/tags
  blk-mq: Defer freeing of tags page_list to SRCU callback
  blk-mq: Defer freeing flush queue to SRCU callback
  blk-mq: Replace tags->lock with SRCU for tag iterators

 block/blk-mq-sched.c   |  4 +-
 block/blk-mq-sysfs.c   |  1 -
 block/blk-mq-tag.c     | 38 +++++++++++++++---
 block/blk-mq.c         | 87 +++++++++++++++++++++---------------------
 block/blk-mq.h         |  4 +-
 block/blk.h            |  1 +
 include/linux/blk-mq.h |  2 +
 7 files changed, 82 insertions(+), 55 deletions(-)

-- 
2.47.0


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

end of thread, other threads:[~2025-08-07  3:44 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-01 11:44 [PATCH 0/5] blk-mq: Replace tags->lock with SRCU for tag iterators Ming Lei
2025-08-01 11:44 ` [PATCH 1/5] blk-mq: Move flush queue allocation into blk_mq_init_hctx() Ming Lei
2025-08-04  6:06   ` Yu Kuai
2025-08-04  7:07   ` Hannes Reinecke
2025-08-01 11:44 ` [PATCH 2/5] blk-mq: Pass tag_set to blk_mq_free_rq_map/tags Ming Lei
2025-08-04  7:08   ` Hannes Reinecke
2025-08-05  7:48   ` Yu Kuai
2025-08-01 11:44 ` [PATCH 3/5] blk-mq: Defer freeing of tags page_list to SRCU callback Ming Lei
2025-08-04  7:09   ` Hannes Reinecke
2025-08-06  9:15   ` Yu Kuai
2025-08-01 11:44 ` [PATCH 4/5] blk-mq: Defer freeing flush queue " Ming Lei
2025-08-04  7:11   ` Hannes Reinecke
2025-08-06  9:17   ` Yu Kuai
2025-08-01 11:44 ` [PATCH 5/5] blk-mq: Replace tags->lock with SRCU for tag iterators Ming Lei
2025-08-04  6:30   ` Yu Kuai
2025-08-04 11:32     ` Ming Lei
2025-08-05  8:33       ` Yu Kuai
2025-08-05  8:38         ` Yu Kuai
2025-08-05  8:48           ` Ming Lei
2025-08-06  1:06             ` Yu Kuai
2025-08-06  8:59               ` Ming Lei
2025-08-06  9:06                 ` Yu Kuai
2025-08-04  7:13   ` Hannes Reinecke
2025-08-04 11:35     ` Ming Lei
2025-08-04 11:45       ` Hannes Reinecke
2025-08-06  9:21   ` Yu Kuai
2025-08-06 13:28     ` Ming Lei
2025-08-07  1:23       ` Yu Kuai
2025-08-07  2:12         ` Ming Lei
2025-08-07  3:44           ` Yu Kuai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox