[RESEND,v2,10/10] block, bfq: remove check of bfq_wr_max_softrt_rate which is always greater than 0
Message ID | 20221222191641.1643117-11-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 c7csp267631wrn; Thu, 22 Dec 2022 03:23:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXuooMo4kaRCcMrxF6id1Vcqf0NGe9yKVcMEPCkeD9rp32yy1a9ffcK3Tyi2uORqEDTIgP+B X-Received: by 2002:a17:906:9c8e:b0:7c1:4a3a:dc97 with SMTP id fj14-20020a1709069c8e00b007c14a3adc97mr4964358ejc.0.1671708196963; Thu, 22 Dec 2022 03:23:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671708196; cv=none; d=google.com; s=arc-20160816; b=ZNfX1byxdbGv9x+7CCypXTkbrhMGk6Q81JrpLfS/SdDD4CQoFW8WpbXXg0dTZceP/+ Vr9L7ba1ooRWOCqE3J1CJQz4FyUIvdMoNPSywFyF91YrDOLqCST/CCACM0WTEQX+E/vd b5TUaDKmRUicjkcpKca20uVte1kbTOIyBHuFDywjukdkGv0UgR4qFyxYEnTnYAzZBUyA oqGIcRyaqSvkempCd2yw46wXRvE6pBYrr0gO34An6GodzdiIwvA+vroabLwYlvPIpJzu BPW4SSZjOkaxFvmC/ZwLetTdpCljPX3DAId2FclDSb2bwiY146eHjR26P8aoXEMDrZLp 6Kzw== 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=AzBKbuclRmaaLOG9c4CRpuXXwXcYnUi9LkIMoA9j0xM=; b=VFcmSrxI2IF+Gzymyg81brtfG0OVi+DM6tw1K7ICwGhYU1e5VVaZoTI1RFLNe7jjxS GKzBHK2Fn0mMk4Jez1PA5YVjyRFD2NH3cbt27kDAo9JFv/3LhDTag4gwgvl6I/sbEqqz Z40VnhhUiEdvbJOCCStkmrOPExIAKVEWazEJbWqKawh65jsr6fko4Tn+HAh27ohaHFjR WrDoDv1uiUQwjY2+lV4EMaoB51jFiMfXEzd29kNESbt9gyxodQZ02+VvlI8TNBxtpDD5 GIJ7m4TOrJlb357kKcKo9tsTbttcC2PkswVsqDHOcWgWnXmg41+GgXEBjtN2WdKlvbXI Zwtg== 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 hq14-20020a1709073f0e00b007c170f6b32esi296643ejc.527.2022.12.22.03.22.53; Thu, 22 Dec 2022 03:23:16 -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 S235454AbiLVLSf (ORCPT <rfc822;pacteraone@gmail.com> + 99 others); Thu, 22 Dec 2022 06:18:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235405AbiLVLRv (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 5CF3D1F611; Thu, 22 Dec 2022 03:17:51 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4Nd78B0HDyz4f3lWy; Thu, 22 Dec 2022 19:17:46 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP2 (Coremail) with SMTP id Syh0CgB3a+nXPKRjMew+AQ--.3596S12; 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 10/10] block, bfq: remove check of bfq_wr_max_softrt_rate which is always greater than 0 Date: Fri, 23 Dec 2022 03:16:41 +0800 Message-Id: <20221222191641.1643117-11-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--.3596S12 X-Coremail-Antispam: 1UD129KBjvJXoW7Cry7Zr47CFyUZFyfJF13Arb_yoW8Gr1kpa yaqr4UWF45Ka1F9F4UtF18Ww1jyan3W3srKw1DZw1DtrW7ZFn3ua9akwnYva92qFn7Crsx ZF1DKa4kXF1DA37anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBab4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAv FVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJw A2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE 3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr2 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Gr0_Xr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwCI42IY 6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aV CY1x0267AKxVW8Jr0_Cr1UYxBIdaVFxhVjvjDU0xZFpf9x07jstxDUUUUU= 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?1752913094615869549?= X-GMAIL-MSGID: =?utf-8?q?1752913094615869549?= |
Series |
A few bugfix and cleancode patch for bfq
|
|
Commit Message
Kemeng Shi
Dec. 22, 2022, 7:16 p.m. UTC
bfqd->bfq_wr_max_softrt_rate is assigned with 7000 in bfq_init_queue and
never changed. So we can remove bfqd->bfq_wr_max_softrt_rate > 0 check
which is always true.
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
block/bfq-iosched.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
Comments
On Fri 23-12-22 03:16:41, Kemeng Shi wrote: > bfqd->bfq_wr_max_softrt_rate is assigned with 7000 in bfq_init_queue and > never changed. So we can remove bfqd->bfq_wr_max_softrt_rate > 0 check > which is always true. > > Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> I would just leave these checks for documentation purposes and for possible experiments (e.g. disabling this logic by setting bfq_wr_max_softrt_rate to 0). Alternatively, we could just define a constant for this and then we can remove all the checks, that would be a clean solution as well. Honza > --- > block/bfq-iosched.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c > index 91bc68fba72d..00cdd42ac02a 100644 > --- a/block/bfq-iosched.c > +++ b/block/bfq-iosched.c > @@ -1788,8 +1788,7 @@ static void bfq_bfqq_handle_idle_busy_switch(struct bfq_data *bfqd, > * to control its weight explicitly) > */ > in_burst = bfq_bfqq_in_large_burst(bfqq); > - soft_rt = bfqd->bfq_wr_max_softrt_rate > 0 && > - !BFQQ_TOTALLY_SEEKY(bfqq) && > + soft_rt = !BFQQ_TOTALLY_SEEKY(bfqq) && > !in_burst && > time_is_before_jiffies(bfqq->soft_rt_next_start) && > bfqq->dispatched == 0 && > @@ -4284,8 +4283,7 @@ void bfq_bfqq_expire(struct bfq_data *bfqd, > if (bfqd->low_latency && bfqq->wr_coeff == 1) > bfqq->last_wr_start_finish = jiffies; > > - if (bfqd->low_latency && bfqd->bfq_wr_max_softrt_rate > 0 && > - RB_EMPTY_ROOT(&bfqq->sort_list)) { > + if (bfqd->low_latency && RB_EMPTY_ROOT(&bfqq->sort_list)) { > /* > * If we get here, and there are no outstanding > * requests, then the request pattern is isochronous > -- > 2.30.0 >
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 91bc68fba72d..00cdd42ac02a 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -1788,8 +1788,7 @@ static void bfq_bfqq_handle_idle_busy_switch(struct bfq_data *bfqd, * to control its weight explicitly) */ in_burst = bfq_bfqq_in_large_burst(bfqq); - soft_rt = bfqd->bfq_wr_max_softrt_rate > 0 && - !BFQQ_TOTALLY_SEEKY(bfqq) && + soft_rt = !BFQQ_TOTALLY_SEEKY(bfqq) && !in_burst && time_is_before_jiffies(bfqq->soft_rt_next_start) && bfqq->dispatched == 0 && @@ -4284,8 +4283,7 @@ void bfq_bfqq_expire(struct bfq_data *bfqd, if (bfqd->low_latency && bfqq->wr_coeff == 1) bfqq->last_wr_start_finish = jiffies; - if (bfqd->low_latency && bfqd->bfq_wr_max_softrt_rate > 0 && - RB_EMPTY_ROOT(&bfqq->sort_list)) { + if (bfqd->low_latency && RB_EMPTY_ROOT(&bfqq->sort_list)) { /* * If we get here, and there are no outstanding * requests, then the request pattern is isochronous