Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8894691rwl; Tue, 10 Jan 2023 21:38:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXunwzFYaOQIB+qO4j1W51rXIzrnTXOgwi6F234yiXPteyn6atHepTaNzGVqSAaZsWHDvwcZ X-Received: by 2002:a17:906:32c3:b0:82a:5b57:3fe4 with SMTP id k3-20020a17090632c300b0082a5b573fe4mr61674913ejk.68.1673415508911; Tue, 10 Jan 2023 21:38:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673415508; cv=none; d=google.com; s=arc-20160816; b=HgHyzTox5O6Nx+MCNrUY/NjYvXAInFTQ+Ol/0ArIMjG/C4nBw4Y29qEY+f+ufODp5z tDvWk2MCKZrYunXf/QnRWFog9ABA0MzKujri4LUGpfCGeFnkGbC0l6HPnY1ieEkunNgU Ft0kpt+5C9TszTKJJ2d35P+AyTBfYlGxh2Q4IMXXFbtrTsO/aPy8kRDtOZ/+GLiAFidi MqY7MwCAkqUr3elouXAg1JusLuf3QbGEGSDW0DPWPNDmazXX6Z8wqUtPcNTOTtgGY+1a YqDKMC0u5IBqDNhMDHcsDgXGyPVTIkI0LSuZO6hjcHtgzneguZyczEV+NfQLpNyYpllD 76tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=p7V8QkjKUke2W6i2VbwvWhdfQxxFtPowYh5MiFF7X70=; b=zoYL3HTucL/ZNyGLkRLM5oLSeWCXNZXntw2C0d3O/IxPGFnVqTXtsfPM3u/0C7OVlw ivKGlYt9ap33vdJAlvwNIuk5dD0Azc6pIZDB4TQX/C6jZ5efFyhDuSCm2M+rvteDLB8B 4LLPd8W8WyzJAtD/+GhiYkeQ7VM0B5lQObyCEpMrt3IdU8OhwFpsx8KMCQOnY6G9bGU9 xBwi2JWlWrjRHBFRe7+pZ31asltIO+ti0QuUQkm3oeXgt133PK97gyx6SYf/4AZegczr G/t7goJKlub3b0N/Da59/QbZcnmDhUicSwsybpBh6N81dAe0BSRiHT/4hvV1BZhdTHM1 Dqbg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr39-20020a1709073fa700b007c4f6c371a8si16179722ejc.519.2023.01.10.21.38.15; Tue, 10 Jan 2023 21:38:28 -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 S231437AbjAKFQb (ORCPT + 55 others); Wed, 11 Jan 2023 00:16:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230282AbjAKFPa (ORCPT ); Wed, 11 Jan 2023 00:15:30 -0500 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A59BEF5AE; Tue, 10 Jan 2023 21:06:52 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id 67CD668BEB; Wed, 11 Jan 2023 06:06:12 +0100 (CET) Date: Wed, 11 Jan 2023 06:06:12 +0100 From: Christoph Hellwig To: Kemeng Shi Cc: 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, john.garry@huawei.com, jack@suse.cz Subject: Re: [PATCH v3 08/14] blk-mq: remove unncessary error count and commit in blk_mq_plug_issue_direct Message-ID: <20230111050612.GB16286@lst.de> References: <20230111130159.3741753-1-shikemeng@huaweicloud.com> <20230111130159.3741753-9-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230111130159.3741753-9-shikemeng@huaweicloud.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE 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: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 11, 2023 at 09:01:53PM +0800, Kemeng Shi wrote: > We need only to explicitly commit in two error cases: > -did not queue everything initially scheduled to queue > -the last attempt to queue a request failed > (see comment of blk_mq_commit_rqs for more details). > Both cases can be checked with ret of last request which breaks list walk. > Remove unnecessary error count and unnecessary commit triggered by error > which is not covered by cases described above. > > Signed-off-by: Kemeng Shi > --- > block/blk-mq.c | 14 ++++---------- > 1 file changed, 4 insertions(+), 10 deletions(-) > > diff --git a/block/blk-mq.c b/block/blk-mq.c > index 98f6003474f2..c6c84f44c7a6 100644 > --- a/block/blk-mq.c > +++ b/block/blk-mq.c > @@ -2706,11 +2706,10 @@ static void blk_mq_plug_issue_direct(struct blk_plug *plug) > struct blk_mq_hw_ctx *hctx = NULL; > struct request *rq; > int queued = 0; > - int errors = 0; > + blk_status_t ret; I think we need to initialize this to BLK_STS_OK here. Otherwise looks good: Reviewed-by: Christoph Hellwig