[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221101093417.10540-4-shikemeng@huawei.com>
Date: Tue, 1 Nov 2022 17:34:00 +0800
From: Kemeng Shi <shikemeng@...wei.com>
To: <paolo.valente@...aro.org>, <axboe@...nel.dk>
CC: <linux-block@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<shikemeng@...wei.com>
Subject: [PATCH 03/20] block, bfq: correct bfq_max_budget and bfq_min_budget
The budgets_assigned is checked to make sure enough samples have been
computed for auto-tuning. Ignore budgets_assigned if auto-tuning is
disabled as bfq_default_max_budget is set by user.
The bfq_default_max_budget check is added after budgets_assigned check,
so no extra cost is added for normal branch to return bfqd->bfq_max_budget.
Signed-off-by: Kemeng Shi <shikemeng@...wei.com>
---
block/bfq-iosched.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 13370c41ad36..b21c3711d69d 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -1485,7 +1485,8 @@ static int bfq_bfqq_budget_left(struct bfq_queue *bfqq)
*/
static int bfq_max_budget(struct bfq_data *bfqd)
{
- if (bfqd->budgets_assigned < bfq_stats_min_budgets)
+ if (bfqd->budgets_assigned < bfq_stats_min_budgets &&
+ bfqd->bfq_user_max_budget == 0)
return bfq_default_max_budget;
else
return bfqd->bfq_max_budget;
@@ -1497,7 +1498,8 @@ static int bfq_max_budget(struct bfq_data *bfqd)
*/
static int bfq_min_budget(struct bfq_data *bfqd)
{
- if (bfqd->budgets_assigned < bfq_stats_min_budgets)
+ if (bfqd->budgets_assigned < bfq_stats_min_budgets &&
+ bfqd->bfq_user_max_budget == 0)
return bfq_default_max_budget / 32;
else
return bfqd->bfq_max_budget / 32;
--
2.30.0
Powered by blists - more mailing lists