[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230219104309.1511562-7-shikemeng@huaweicloud.com>
Date: Sun, 19 Feb 2023 18:42:58 +0800
From: Kemeng Shi <shikemeng@...weicloud.com>
To: paolo.valente@...aro.org, axboe@...nel.dk, jack@...e.cz
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
shikemeng@...weicloud.com
Subject: [PATCH 06/17] block, bfq: correct bfq_max_budget and bfq_min_budget
For case that user set a max_budget, we should use bfq_max_budget
set by user instead of bfq_default_max_budget when budgets_assigned
is not enough to compulte auto-tuning max_budget.
Signed-off-by: Kemeng Shi <shikemeng@...weicloud.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 5b08711cbaf6..b32bae5259d5 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -1458,7 +1458,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;
@@ -1470,7 +1471,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