Message ID | 20230219104309.1511562-12-shikemeng@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp656572wrn; Sat, 18 Feb 2023 18:44:02 -0800 (PST) X-Google-Smtp-Source: AK7set+q1BCitLgTHRmEPs1nJ5m3nGn8Si65wJo9COUPy8IzAcp7o2j6Hui5W7ecn0WPOMAMXLhx X-Received: by 2002:a17:902:d2cd:b0:19a:98e8:50d1 with SMTP id n13-20020a170902d2cd00b0019a98e850d1mr3969570plc.34.1676774641912; Sat, 18 Feb 2023 18:44:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676774641; cv=none; d=google.com; s=arc-20160816; b=SLO4HXp/SLyf8EmgZ4Bcbt6LClvm5jUW33+rjbWU3KUU8ohMjlAy1fs4tWPi1flO3B CNEWiQHNAzw/cc7ONUU9CchrhkNCk+zqNoHdgLX2RsStaCEvRkgTBL1WuqZC9PUtpFTp gEUpaTLE24mDlE5Jkf8MHMYB0IaETzVV+3JMXVq8XU5z1mOmJQTi7bpdBNVri1qa78J4 +UghjHE5gNm6YdRkxIbCpGvAxiTiS6gxpJJ5OS+3IcWVgYGhzgRfMn1z393faaOoc1eO 9XR94mJvKQuyyy7g6bwaetcXJ6nU4vQxP+fbPom0woJY7FWNQK1Fqdgs5YCNycYekq76 NypA== 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=O7vdEK+86orzbHchQId1JvbHBuNmJb2zls1eSOVkg0M=; b=CuVV+KXFYeDE9SZi99OAmz/XHg9WCRV2lNrhspSCdmpofH61IG85XLULYGrOzCg+lB gRC5Dwu1pDdshfj3MAqiF1j9IC1OkIMyC4XCcy2VQzqNI6Dd79d6+k2NePZuo/ZZUajH /4Qix5bmZiZjTdOxy/L0dDryGHs9WO4me1MPVOZe1FOxbDcPIr0aXtOTn8M7odWVL+6f K2Qd69bt7hZ7zKiEqn+7FBEnO8UrhLgVYiuYye7JgwHKMHoudwz3jThz3VUzd+O6qz06 VGwm3IP5E9laeim+s18WDwwojCyfHcSTfnlQCL+qrqpJkX+i8TNk3Xsahd++I1fI3kgh iD1g== 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 z15-20020a1709027e8f00b00196cfe1ca6dsi4206325pla.551.2023.02.18.18.43.49; Sat, 18 Feb 2023 18:44:01 -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 S229574AbjBSCly (ORCPT <rfc822;nanshango2@gmail.com> + 99 others); Sat, 18 Feb 2023 21:41:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbjBSCl2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 18 Feb 2023 21:41:28 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4309912865; Sat, 18 Feb 2023 18:41:28 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4PK8v74QlLz4f3pBn; Sun, 19 Feb 2023 10:41:23 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP2 (Coremail) with SMTP id Syh0CgBH7utQjPFjPmleDw--.7604S13; Sun, 19 Feb 2023 10:41:25 +0800 (CST) From: Kemeng Shi <shikemeng@huaweicloud.com> To: paolo.valente@linaro.org, axboe@kernel.dk, jack@suse.cz Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, shikemeng@huaweicloud.com Subject: [PATCH 11/17] block, bfq: simpfy computation of bfqd->budgets_assigned Date: Sun, 19 Feb 2023 18:43:03 +0800 Message-Id: <20230219104309.1511562-12-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230219104309.1511562-1-shikemeng@huaweicloud.com> References: <20230219104309.1511562-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: Syh0CgBH7utQjPFjPmleDw--.7604S13 X-Coremail-Antispam: 1UD129KBjvJXoWrtw17JrW7ZrWktw13AFW7XFb_yoW8Jr4xpr 9Fgw4j9F47tF15ZFWxGwn0g3Z8KanxXr97tr4aq392yFWDZrnFqFsay34rJFySgr97Aw13 Xa9rWFy7Xw4akaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUPF14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2jI8I6cxK62vIxIIY0VWUZVW8XwA2048vs2IY02 0E87I2jVAFwI0_JF0E3s1l82xGYIkIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0 rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6x IIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xv wVC2z280aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFc xC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_ Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2 IErcIFxwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E 14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIx kGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVW8JVW5JwCI42IY6xIIjxv20xvEc7CjxVAF wI0_Cr0_Gr1UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JV WxJwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjTRKfOw UUUUU 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_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: <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?1758225647150026690?= X-GMAIL-MSGID: =?utf-8?q?1758225647150026690?= |
Series |
Some bugfix and cleanup patches for bfq
|
|
Commit Message
Kemeng Shi
Feb. 19, 2023, 10:43 a.m. UTC
The computation of budgets_assigned is a little confusing as we only need
to check if it's updated more than 10 times. Simpfy the computation to
improve readability.
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
block/bfq-iosched.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 2559343593bb..a8cb0a0d36f3 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -175,7 +175,7 @@ static const int bfq_back_penalty = 2; static u64 bfq_slice_idle = NSEC_PER_SEC / 125; /* Minimum number of assigned budgets for which stats are safe to compute. */ -static const int bfq_stats_min_budgets = 194; +static const int bfq_stats_min_budgets = 11; /* Default maximum budget values, in sectors and number of requests. */ static const int bfq_default_max_budget = 16 * 1024; @@ -3317,7 +3317,7 @@ static void __bfq_set_in_service_queue(struct bfq_data *bfqd, if (bfqq) { bfq_clear_bfqq_fifo_expire(bfqq); - bfqd->budgets_assigned = (bfqd->budgets_assigned * 7 + 256) / 8; + bfqd->budgets_assigned++; if (time_is_before_jiffies(bfqq->last_wr_start_finish) && bfqq->wr_coeff > 1 &&