Patch "blk-mq: don't insert passthrough request into sw queue" has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    blk-mq: don't insert passthrough request into sw queue

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     blk-mq-don-t-insert-passthrough-request-into-sw-queu.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 645fc590b8aa63978875e3e6991d519c17ee62d5
Author: Ming Lei <ming.lei@xxxxxxxxxx>
Date:   Wed Jun 21 21:22:08 2023 +0800

    blk-mq: don't insert passthrough request into sw queue
    
    [ Upstream commit 2293cae703cda162684ae966db6b1b4a11b5e88f ]
    
    In case of real io scheduler, q->elevator is set, so blk_mq_run_hw_queue()
    may just check if scheduler queue has request to dispatch, see
    __blk_mq_sched_dispatch_requests(). Then IO hang may be caused because
    all passthorugh requests may stay in sw queue.
    
    And any passthrough request should have been inserted to hctx->dispatch
    always.
    
    Reported-by: Guangwu Zhang <guazhang@xxxxxxxxxx>
    Fixes: d97217e7f024 ("blk-mq: don't queue plugged passthrough requests into scheduler")
    Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230621132208.1142318-1-ming.lei@xxxxxxxxxx
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/block/blk-mq.c b/block/blk-mq.c
index c763f0bc66371..b9f4546139894 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2735,7 +2735,12 @@ static void blk_mq_dispatch_plug_list(struct blk_plug *plug, bool from_sched)
 
 	percpu_ref_get(&this_hctx->queue->q_usage_counter);
 	/* passthrough requests should never be issued to the I/O scheduler */
-	if (this_hctx->queue->elevator && !is_passthrough) {
+	if (is_passthrough) {
+		spin_lock(&this_hctx->lock);
+		list_splice_tail_init(&list, &this_hctx->dispatch);
+		spin_unlock(&this_hctx->lock);
+		blk_mq_run_hw_queue(this_hctx, from_sched);
+	} else if (this_hctx->queue->elevator) {
 		this_hctx->queue->elevator->type->ops.insert_requests(this_hctx,
 				&list, 0);
 		blk_mq_run_hw_queue(this_hctx, from_sched);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux