blk-mq: move srcu from blk_mq_hw_ctx to request_queue
In case of BLK_MQ_F_BLOCKING, per-hctx srcu is used to protect dispatch critical area. However, this srcu instance stays at the end of hctx, and it often takes standalone cacheline, often cold. Inside srcu_read_lock() and srcu_read_unlock(), WRITE is always done on the indirect percpu variable which is allocated from heap instead of being embedded, srcu->srcu_idx is read only in srcu_read_lock(). It doesn't matter if srcu structure stays in hctx or request queue. So switch to per-request-queue srcu for protecting dispatch, and this way simplifies quiesce a lot, not mention quiesce is always done on the request queue wide. Signed-off-by:Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/20211203131534.3668411-3-ming.lei@redhat.com Signed-off-by:
Jens Axboe <axboe@kernel.dk>
Showing
- block/blk-core.c 22 additions, 5 deletionsblock/blk-core.c
- block/blk-mq-sysfs.c 0 additions, 2 deletionsblock/blk-mq-sysfs.c
- block/blk-mq.c 8 additions, 29 deletionsblock/blk-mq.c
- block/blk-mq.h 2 additions, 2 deletionsblock/blk-mq.h
- block/blk-sysfs.c 2 additions, 1 deletionblock/blk-sysfs.c
- block/blk.h 9 additions, 1 deletionblock/blk.h
- block/genhd.c 1 addition, 1 deletionblock/genhd.c
- include/linux/blk-mq.h 0 additions, 8 deletionsinclude/linux/blk-mq.h
- include/linux/blkdev.h 9 additions, 0 deletionsinclude/linux/blkdev.h
Please register or sign in to comment