lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 19 Feb 2023 18:42:56 +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 04/17] block, bfq: recover the "service hole" if enough budget is left

If budget left is less than budget need by next request, the activated bfqq
will be expired if it preempts the in-service queue. Avoid to cause useless
overhead to check budget left is enough for next request.

Signed-off-by: Kemeng Shi <shikemeng@...weicloud.com>
---
 block/bfq-iosched.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 7b416f9471b3..edbf5c9aeb47 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -1588,13 +1588,15 @@ static bool bfq_bfqq_update_budg_for_activation(struct bfq_data *bfqd,
 
 	/*
 	 * In the next compound condition, we check also whether there
-	 * is some budget left, because otherwise there is no point in
-	 * trying to go on serving bfqq with this same budget: bfqq
-	 * would be expired immediately after being selected for
-	 * service. This would only cause useless overhead.
+	 * is some budget left for next request to serve, because
+	 * otherwise there is no point in trying to go on serving bfqq
+	 * with this same budget: bfqq would be expired immediately
+	 * after being selected for service. This would only cause
+	 * useless overhead.
 	 */
 	if (bfq_bfqq_non_blocking_wait_rq(bfqq) && arrived_in_time &&
-	    bfq_bfqq_budget_left(bfqq) > 0) {
+	    bfq_bfqq_budget_left(bfqq) >=
+	    bfq_serv_to_charge(bfqq->next_rq, bfqq)) {
 		/*
 		 * We do not clear the flag non_blocking_wait_rq here, as
 		 * the latter is used in bfq_activate_bfqq to signal
-- 
2.30.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ