[RESEND,v2,08/10] block, bfq: remove unnecessary goto tag in bfq_dispatch_rq_from_bfqq
Message ID | 20221222191641.1643117-9-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 c7csp266782wrn; Thu, 22 Dec 2022 03:20:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXuJqfORyT/jxQZpCd7+g5gsej5aLgemsrEQSLKtbEywtc3IxFTv7yh5n/wcrTaYxvDXEWNF X-Received: by 2002:a05:6402:e0f:b0:468:58d4:a0f2 with SMTP id h15-20020a0564020e0f00b0046858d4a0f2mr5162234edh.23.1671708058739; Thu, 22 Dec 2022 03:20:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671708058; cv=none; d=google.com; s=arc-20160816; b=E9m37CzSvBgMLkCNx9UQpMFwWbKxuotzBtGROtxhGXuuN7Gp4urvGyzHoCin6DeAvW khDuxrLbFiGpm7ZAe8EbmAv911zlvnVa5hXwErrVlITTs8c0C/VysFkPCw9zQir5pvE3 Eu7nHI1qeKvAok51D1ChZEYiiQeVbXOC6TshytPz2x2NEQ7BoYchoWtZ1COG9KBGlTYj jW1uRfGE5mUokSoTebDCfBJOhLw9UprtuIJj8yt/RzwUiuyZVny+C76sBhM+lPmMZNKV yBIP1v8DZydH9o2oR6pUvTUE6RHRrm5wMNbTfxWGlXKCpsWeIIcPULk5jKrukQo8KZnF aqTw== 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=v19krDeEoBBHxEwUCLaqoVcgh4K36bpocqLOFoTMjaU=; b=0X9fshKJ2ny+pQX0iRMM7YywwT20S0kaEM+u5OCgH15lLSd0qOuKAuW+3bwycZ9WBX n93sIUIXt6qW4vNtswKGYMALDg/zr3lnlDKBYSkj0aIfyM4oRS7UkCz+vlPXDre8gtA6 y+Mep3KV43nu3+Pz0Tn4UJI9T3qyIJfilC7YWQlpUMmX2E3rD8/FuAz08j+hFMnvbJv6 pPvSiMuu0YM2BNSOHUiwZbmOs+0o9TMFc0qGxGN9twJL7Q4RcoChYVT6b7YJZK3J7ax5 LU9v60wYoUFvzZTQdnBzDfoeb7s25I73bb8j58vHj4bmyNId/opbe7aJ2dvMhUn6QN1u ED0w== 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 s25-20020a056402037900b004593671898esi420011edw.611.2022.12.22.03.20.32; Thu, 22 Dec 2022 03:20:58 -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 S235482AbiLVLSU (ORCPT <rfc822;pacteraone@gmail.com> + 99 others); Thu, 22 Dec 2022 06:18:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235389AbiLVLRv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 22 Dec 2022 06:17:51 -0500 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A318022BD8; Thu, 22 Dec 2022 03:17:50 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4Nd7892rr7z4f3pFL; Thu, 22 Dec 2022 19:17:45 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP2 (Coremail) with SMTP id Syh0CgB3a+nXPKRjMew+AQ--.3596S10; Thu, 22 Dec 2022 19:17:48 +0800 (CST) From: Kemeng Shi <shikemeng@huaweicloud.com> To: paolo.valente@linaro.org, axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: jack@suse.cz, hch@lst.de, damien.lemoal@wdc.com Subject: [PATCH RESEND v2 08/10] block, bfq: remove unnecessary goto tag in bfq_dispatch_rq_from_bfqq Date: Fri, 23 Dec 2022 03:16:39 +0800 Message-Id: <20221222191641.1643117-9-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20221222191641.1643117-1-shikemeng@huaweicloud.com> References: <20221222191641.1643117-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: Syh0CgB3a+nXPKRjMew+AQ--.3596S10 X-Coremail-Antispam: 1UD129KBjvdXoWruF4UWF4DWFyxKr47GF15urg_yoWkZFXEyF 409r9ayFWkCF98Wr4YkFsrJF1jyFW2qa1DtF1Fg3y2g3W7J3ZYyF9IqrsIka95WrWIkFyY qFs0q343Jr1UXjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbSxYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r126s0DM28IrcIa0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC 64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM2 8EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq 3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE 14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x 0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E 7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcV C0I7IYx2IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6x kF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUIL05UUUUU 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?1752912949510550516?= X-GMAIL-MSGID: =?utf-8?q?1752912949510550516?= |
Series |
A few bugfix and cleancode patch for bfq
|
|
Commit Message
Kemeng Shi
Dec. 22, 2022, 7:16 p.m. UTC
We jump to tag only for returning current rq. Return directly to
remove this tag.
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
block/bfq-iosched.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
Comments
On Fri 23-12-22 03:16:39, Kemeng Shi wrote: > We jump to tag only for returning current rq. Return directly to > remove this tag. > > Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> One nit below. > diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c > index 89995815dbae..195cdc6be087 100644 > --- a/block/bfq-iosched.c > +++ b/block/bfq-iosched.c > @@ -4965,7 +4965,7 @@ static struct request *bfq_dispatch_rq_from_bfqq(struct bfq_data *bfqd, > bfq_dispatch_remove(bfqd->queue, rq); > > if (bfqq != bfqd->in_service_queue) > - goto return_rq; > + return rq; > > /* > * If weight raising has to terminate for bfqq, then next > @@ -4985,12 +4985,9 @@ static struct request *bfq_dispatch_rq_from_bfqq(struct bfq_data *bfqd, > * belongs to CLASS_IDLE and other queues are waiting for > * service. > */ > - if (!(bfq_tot_busy_queues(bfqd) > 1 && bfq_class_idle(bfqq))) > - goto return_rq; > + if ((bfq_tot_busy_queues(bfqd) > 1 && bfq_class_idle(bfqq))) ^ unnecessary brace here Honza > + bfq_bfqq_expire(bfqd, bfqq, false, BFQQE_BUDGET_EXHAUSTED); > > - bfq_bfqq_expire(bfqd, bfqq, false, BFQQE_BUDGET_EXHAUSTED); > - > -return_rq: > return rq; > } > > -- > 2.30.0 >
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 89995815dbae..195cdc6be087 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -4965,7 +4965,7 @@ static struct request *bfq_dispatch_rq_from_bfqq(struct bfq_data *bfqd, bfq_dispatch_remove(bfqd->queue, rq); if (bfqq != bfqd->in_service_queue) - goto return_rq; + return rq; /* * If weight raising has to terminate for bfqq, then next @@ -4985,12 +4985,9 @@ static struct request *bfq_dispatch_rq_from_bfqq(struct bfq_data *bfqd, * belongs to CLASS_IDLE and other queues are waiting for * service. */ - if (!(bfq_tot_busy_queues(bfqd) > 1 && bfq_class_idle(bfqq))) - goto return_rq; + if ((bfq_tot_busy_queues(bfqd) > 1 && bfq_class_idle(bfqq))) + bfq_bfqq_expire(bfqd, bfqq, false, BFQQE_BUDGET_EXHAUSTED); - bfq_bfqq_expire(bfqd, bfqq, false, BFQQE_BUDGET_EXHAUSTED); - -return_rq: return rq; }