Message ID | 20230111130159.3741753-11-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 p1csp3131965wrt; Tue, 10 Jan 2023 21:05:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXu/2P/0P+BEuPFtEXI9q9uRN+yfSzBtEuZzIk8Rjze4lFgQMg0kaynhhIvr1M524fabH8iC X-Received: by 2002:a17:90b:110a:b0:223:2001:4ee8 with SMTP id gi10-20020a17090b110a00b0022320014ee8mr73537228pjb.27.1673413543603; Tue, 10 Jan 2023 21:05:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673413543; cv=none; d=google.com; s=arc-20160816; b=OlPp2w3fHLhPh16GdHMUAhoN1ytwwtccx5TRG28iGJfnnT+UMNY7JqoXmlXSpgGB5e b30CPaOKWmhiy9i759ZVGN6IELeJPDRQPZghJX6UeCbqxaIL79OB3wJVLVc5dmff0seH 6Aqey0SJG2h6FQwAnfBxm/liaZmHGD0YwbeU1JQF4TNDmCCxRgKOEygJH67W1D6iMEFD pZCOOnNsgpgY8IvCh4h/MfLyZ4JHF/AbSCfUIKybfjG/oXzd2nCij6WLRDCOk8Kfu8LE QiNRWTMYXp/92XorozwUplUt/oiPUyQ2zlzrqB/Y5UrL40e4ymX58bfQpfMoSTrthP1L qdTg== 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=IH2uUCUSEje/S3iDkLwEDp+2NY0WtRVW30n5vCDCJmc=; b=bEZ+g3oaG2UJXXtF1PUF20i/Bamu3+UutxGwWPTVVAMHIaiOduDbWt1iR9VxgJL4am e6f/loVbDPP0dQQMQY/BzhsBVeh20ezlYt4UbLoBLIAYYNAj01wozzdhITgpv1V56ojJ 0EALRL3Bdw0ghad6cuS8VelaOY+hP+RXVI3pRvyFy1obhgUouH3SbgMukE7pfIZbl35i A4rBRLhfG1YZ/ofo8rz3t+dJisn1kwUgK2WlbTVKf4XTNADYY/IKpeDE0KvGEhBev+7d rJfmGU6icIg8eguJGwt94cr2JXSUCZgsB7Reovlmg6O9QxUV+JbIaRPy8Pu87vkV+i+n KTMA== 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 s16-20020a634510000000b00476d24ebb04si13851780pga.322.2023.01.10.21.05.30; Tue, 10 Jan 2023 21:05: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 S235865AbjAKFEH (ORCPT <rfc822;syz17693488234@gmail.com> + 99 others); Wed, 11 Jan 2023 00:04:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234664AbjAKFDf (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 11 Jan 2023 00:03:35 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A05FDF21; Tue, 10 Jan 2023 21:03:35 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4NsFv54X93z4f3ydK; Wed, 11 Jan 2023 13:03:29 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP1 (Coremail) with SMTP id cCh0CgDX9S8fQ75jGl2gBQ--.10280S12; Wed, 11 Jan 2023 13:03:32 +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 10/14] blk-mq: simplify flush check in blk_mq_dispatch_rq_list Date: Wed, 11 Jan 2023 21:01:55 +0800 Message-Id: <20230111130159.3741753-11-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--.10280S12 X-Coremail-Antispam: 1UD129KBjvJXoW7ZFW7tr1DXFW7tryrWr43Awb_yoW8Xr47pF ZxCa9Fkr4agw17try8ua97Ga4DAwsYkF15Wrs3Aw1agF45Cr4xKrWSqw47WFykArsYyw4Y qFWDWFWjvFyUXa7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBIb4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAv FVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3w A2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE 3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr2 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r106r15McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Gr0_Xr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwCI42IY 6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aV CY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU058n7UUUUU== 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?1754701279961518770?= X-GMAIL-MSGID: =?utf-8?q?1754701279961518770?= |
Series |
A few bugfix and cleanup patches for blk-mq
|
|
Commit Message
Kemeng Shi
Jan. 11, 2023, 1:01 p.m. UTC
1. Remove check of needs_resource and ret == BLK_STS_DEV_RESOURCE.
For busy error BLK_STS*_RESOURCE, request will always be added
back to list, so need_resource will not be true and ret will
not be == BLK_STS_DEV_RESOURCE if list is empty. We could remove
these dead check.
2. Check ret of last request instead of errors
If list is empty, we only need to explicitly commit_rqs
if error happens at last request which is stored in ret. So check
ret of last request instead of errors to remove unnecessary
commit_rqs triggered by errors returned from previous request.
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
block/blk-mq.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Comments
> + if ((!list_empty(list) || ret != BLK_STS_OK))
Plase drop the double braces.
diff --git a/block/blk-mq.c b/block/blk-mq.c index f45d81e20d9e..8fd25713751c 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2114,9 +2114,9 @@ bool blk_mq_dispatch_rq_list(struct blk_mq_hw_ctx *hctx, struct list_head *list, /* If we didn't flush the entire list, we could have told the driver * there was more coming, but that turned out to be a lie. */ - if ((!list_empty(list) || errors || needs_resource || - ret == BLK_STS_DEV_RESOURCE) && q->mq_ops->commit_rqs && queued) - q->mq_ops->commit_rqs(hctx); + if ((!list_empty(list) || ret != BLK_STS_OK)) + blk_mq_commit_rqs(hctx, queued); + /* * Any items that need requeuing? Stuff them into hctx->dispatch, * that is where we will continue on next queue run.