Message ID | 20221223125223.1687670-5-shikemeng@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp138674wrn; Thu, 22 Dec 2022 20:55:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXvKuNrD8SGFq+2VVSYb7cikAEWc2XdVqdxsX/tPSOfUjLQlRrpcfoizw/QpeztqBoJdpEXK X-Received: by 2002:a05:6a20:94c5:b0:b0:1e9b:e932 with SMTP id ht5-20020a056a2094c500b000b01e9be932mr10403816pzb.40.1671771348217; Thu, 22 Dec 2022 20:55:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671771348; cv=none; d=google.com; s=arc-20160816; b=l2rRPWm7l4lef90rowvM4Eenk9mpbV8PqhkgpBa4UAdvb7v05/kS8XIUNk/eDnuL0q M2MYBxThlYpEwS3r20SWIukFWWrnFBoEZTFQdMX0hwbOZkhHwLJG3is6aBYGlcfZJXuc Cpiyee+iqRqEgP05b8pidkwLde6lbI9rRoW/dpo0ivA6Qytk0F6dLf3y/+yQSEtShXcZ 8NzBWzyWPSbGLduGRQxbyfJIS7tQeVkBXhkOdAODoDcIZXYWW5gKDOVjcnBdiRht5jpy 7aSHjqJZU0lEzgcGAgMRkDOgKq+2RlVPyUtT45yHfDCAFN9iMJFc+lcRgyHjI06JSsfq TQog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=nfmyH3aPrlK7ljT8eSwqFnZh7YTyi/jpWe+Tua80BAA=; b=QxousBt4A8x4+hwj99B5Imd/xaC/2ZISI291C1TNBLVC+57LUJ/BvnGIc7o8YBayVp ItSE37jwlcS9idJRwdYLmjVC0RPXE2pIDtml1Dl2q7KcCP5pwIJvkDR09kZ10BM1OIgI ktjZ6aqS+sq+xmwifk3UQVCalxMWC54yyz1Ht5M1EXlKZdhg3xwfuO6GaCL/5Fl9QRZy a0JbT2hA48EnnGh/oebdKOigKb5/hmbAe/R4s5/68fHRPoxIkv8OxYlVdQcXF5ytdfjs 4vsHjR7lsdl9aedqSG28pPBtpyl9Qwl4BlIR3DEka05hmBQ8mR9oAFRxaFVQ1qzCQk77 bHzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t12-20020a65608c000000b00477b0e028e2si2690147pgu.810.2022.12.22.20.55.35; Thu, 22 Dec 2022 20:55:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235833AbiLWEyL (ORCPT <rfc822;pacteraone@gmail.com> + 99 others); Thu, 22 Dec 2022 23:54:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229978AbiLWExd (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 22 Dec 2022 23:53:33 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8828201B9; Thu, 22 Dec 2022 20:53:32 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4NdZZH3WYrz4f3p5K; Fri, 23 Dec 2022 12:53:27 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgDXjbFHNKVjpOduAQ--.93S6; Fri, 23 Dec 2022 12:53:30 +0800 (CST) From: Kemeng Shi <shikemeng@huaweicloud.com> To: axboe@kernel.dk, dwagner@suse.de, hare@suse.de, ming.lei@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: hch@lst.de, john.garry@huawei.com, shikemeng@huaweicloud.com Subject: [PATCH 04/13] blk-mq: Fix potential io hung for shared sbitmap per tagset Date: Fri, 23 Dec 2022 20:52:14 +0800 Message-Id: <20221223125223.1687670-5-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20221223125223.1687670-1-shikemeng@huaweicloud.com> References: <20221223125223.1687670-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgDXjbFHNKVjpOduAQ--.93S6 X-Coremail-Antispam: 1UD129KBjvJXoW7CFW7tFy5CFyfXr4Duw1ftFb_yoW8AF48pr WftF1DKwsaqr1qvFWxXa17KF10krs5K3s3J393WrsIv34UKr1xJFWIgay3JF10vFZ3ArW3 Zay5tFyUZwn5X37anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUP014x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2jI8I6cxK62vIxIIY0VWUZVW8XwA2048vs2IY02 0E87I2jVAFwI0_JF0E3s1l82xGYIkIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0 rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6x IIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK 6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4 xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8 JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20V AGYxC7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAF wI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc4 0Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AK xVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr 1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7sRiVbyDUU UUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752979313178193291?= X-GMAIL-MSGID: =?utf-8?q?1752979313178193291?= |
Series |
A few bugfix and cleanup patches for blk-mq
|
|
Commit Message
Kemeng Shi
Dec. 23, 2022, 12:52 p.m. UTC
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@huaweicloud.com>
---
block/blk-mq.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c index 202975f4d357..bfba0e151733 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1824,7 +1824,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); /* @@ -2094,7 +2095,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);