[v3,05/14] blk-mq: remove unnecessary list_empty check in blk_mq_try_issue_list_directly
Message ID | 20230111130159.3741753-6-shikemeng@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3131692wrt; Tue, 10 Jan 2023 21:04:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXvN77RMpwiAg/UD4ZOo4YlXi4VpB0MAdMdo4wucsxHFevLiewVRJ3eh9NGZs636QhLP4wt7 X-Received: by 2002:a17:903:2652:b0:192:8e0a:16b with SMTP id je18-20020a170903265200b001928e0a016bmr49318185plb.14.1673413483994; Tue, 10 Jan 2023 21:04:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673413483; cv=none; d=google.com; s=arc-20160816; b=Nn+prUWyHL2+nCRgv+K4Zqqg5mr30UtTTMypJTR22IXIp1yokyHc/jI7QtuR0ZVqQ8 uAWLdp97PyDxCbQkYizA2Qr/1NAXV5ioorbFJZWWEUtkS7XWwfI6tutF2weI+kq2C4Gp SnUMkSVevLpvrDLVmsLmR9VbIzL2QBgk1hs6ptB0WEFQnXPXTmblDqmRpIKepIx3QQpq JSGu348LOIRrOUCdGjyxcIk/0Xwh2iO6gO5/bcI60kYxqaDYHhbUkvlR3sbvKXZ1E82g Rz5nex0UNXx7xvVddanqRzxvfrz6zMEeXs0XVSx6tNALAMC/A7BAtIj5zpU6ZFGaZRnR 0acA== 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=WvZ0dICnE0gewjcovSek9M/bgPlV8QOMj94zXLaiQXA=; b=NOLVRHUuDLeWi7zJb0Oi+Pa316xVEXvjqtio4ax7WBQfrov989rf0hKy6d3SsfBN+M KNkULip3cctaWUcf29hS23jpZq1EYhsi5BmAvEtbue64yP/xUo4MlZPh1z+hl51e5Cz7 kp/NE7I7mt5OPEo94oyYa/mT3rN7jRzEPDEb3BypYRVF8/kAQtFLADoxCIe5mjenP4qf uPhZziCfv/Rilp6LwBm9E+hzWfyZWmr5OoqUpch3kqFo1l8lkE4Fi92Ow72NEHZgvkao ujgX0TcjPWpa2XmDHokNEO7SZnLOljcKje0vxVxw4YabyoEdgvuSKle/wZAwMulJIjKn 59LQ== 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 c6-20020a170902c1c600b00192f4b0a9e1si12598061plc.20.2023.01.10.21.04.31; Tue, 10 Jan 2023 21:04:43 -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 S235631AbjAKFDy (ORCPT <rfc822;syz17693488234@gmail.com> + 99 others); Wed, 11 Jan 2023 00:03:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233598AbjAKFDe (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 11 Jan 2023 00:03:34 -0500 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA8A5D100; Tue, 10 Jan 2023 21:03:33 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4NsFv340gHz4f3s6m; Wed, 11 Jan 2023 13:03:27 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP1 (Coremail) with SMTP id cCh0CgDX9S8fQ75jGl2gBQ--.10280S7; Wed, 11 Jan 2023 13:03:30 +0800 (CST) From: Kemeng Shi <shikemeng@huaweicloud.com> To: hch@lst.de, axboe@kernel.dk, dwagner@suse.de, hare@suse.de, ming.lei@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: john.garry@huawei.com, jack@suse.cz Subject: [PATCH v3 05/14] blk-mq: remove unnecessary list_empty check in blk_mq_try_issue_list_directly Date: Wed, 11 Jan 2023 21:01:50 +0800 Message-Id: <20230111130159.3741753-6-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230111130159.3741753-1-shikemeng@huaweicloud.com> References: <20230111130159.3741753-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: cCh0CgDX9S8fQ75jGl2gBQ--.10280S7 X-Coremail-Antispam: 1UD129KBjvdXoWrKr1xWry5Kw1Utw48Ww18uFg_yoWDArX_uF y0yw1kXayDJF17Ar4I93W0yFn8KryDWr1fXFZ3KFy5GFyfXFn8Was5KF4rZ3y7Gay7K34a 9r1rXF9Fyr10gjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbSxYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r126s0DM28IrcIa0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC 64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM2 8EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq 3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE 14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x 0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E 7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcV C0I7IYx2IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUxD7aUUUUU 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?1754701216915530089?= X-GMAIL-MSGID: =?utf-8?q?1754701216915530089?= |
Series |
A few bugfix and cleanup patches for blk-mq
|
|
Commit Message
Kemeng Shi
Jan. 11, 2023, 1:01 p.m. UTC
We only break the list walk if we get 'BLK_STS_*RESOURCE'. We also count errors for 'BLK_STS_*RESOURCE' error. If list is not empty, errors will always be non-zero. So we can remove unnecessary list_empty check. This will remove redundant list_empty check for case that error happened at sending last request in list. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> --- block/blk-mq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c index 2bfe83f2bcca..ca2be137d6db 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2839,8 +2839,7 @@ void blk_mq_try_issue_list_directly(struct blk_mq_hw_ctx *hctx, * the driver there was more coming, but that turned out to * be a lie. */ - if ((!list_empty(list) || errors) && - hctx->queue->mq_ops->commit_rqs && queued) + if (errors && hctx->queue->mq_ops->commit_rqs && queued) hctx->queue->mq_ops->commit_rqs(hctx); }