Patch "blk-mq: Fix potential io hung for shared sbitmap per tagset" has been added to the 6.1-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: Fix potential io hung for shared sbitmap per tagset

to the 6.1-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-fix-potential-io-hung-for-shared-sbitmap-per-.patch
and it can be found in the queue-6.1 subdirectory.

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



commit 74c0ea813123c41376fed91bc07c9ad0c8ab1c65
Author: Kemeng Shi <shikemeng@xxxxxxxxxxxxxxx>
Date:   Wed Jan 18 17:37:16 2023 +0800

    blk-mq: Fix potential io hung for shared sbitmap per tagset
    
    [ Upstream commit 47df9ce95cd568d3f84218c4f65e9fbd4dfeda55 ]
    
    Commit f906a6a0f4268 ("blk-mq: improve tag waiting setup for non-shared
    tags") mark restart for unshared tags for improvement. At that time,
    tags is only shared betweens queues and we can check if tags is shared
    by test BLK_MQ_F_TAG_SHARED.
    Afterwards, commit 32bc15afed04b ("blk-mq: Facilitate a shared sbitmap per
    tagset") enabled tags share betweens hctxs inside a queue. We only
    mark restart for shared hctxs inside a queue and may cause io hung if
    there is no tag currently allocated by hctxs going to be marked restart.
    Wait on sbitmap_queue instead of mark restart for shared hctxs case to
    fix this.
    
    Fixes: 32bc15afed04 ("blk-mq: Facilitate a shared sbitmap per tagset")
    Signed-off-by: Kemeng Shi <shikemeng@xxxxxxxxxxxxxxx>
    Reviewed-by: Christoph Hellwig <hch@xxxxxx>
    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 faffc64fe4ce8..fe0a3a882f465 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1799,7 +1799,8 @@ static bool blk_mq_mark_tag_wait(struct blk_mq_hw_ctx *hctx,
 	wait_queue_entry_t *wait;
 	bool ret;
 
-	if (!(hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED)) {
+	if (!(hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED) &&
+	    !(blk_mq_is_shared_tags(hctx->flags))) {
 		blk_mq_sched_mark_restart_hctx(hctx);
 
 		/*
@@ -2069,7 +2070,8 @@ bool blk_mq_dispatch_rq_list(struct blk_mq_hw_ctx *hctx, struct list_head *list,
 		bool needs_restart;
 		/* For non-shared tags, the RESTART check will suffice */
 		bool no_tag = prep == PREP_DISPATCH_NO_TAG &&
-			(hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED);
+			((hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED) ||
+			blk_mq_is_shared_tags(hctx->flags));
 
 		if (nr_budgets)
 			blk_mq_release_budgets(q, list);



[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