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-next>] [day] [month] [year] [list]
Date:   Mon, 16 May 2022 18:19:09 +0800
From:   Chengming Zhou <zhouchengming@...edance.com>
To:     tj@...nel.org, axboe@...nel.dk
Cc:     linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
        duanxiongchun@...edance.com, songmuchun@...edance.com,
        Chengming Zhou <zhouchengming@...edance.com>
Subject: [PATCH] blk-iocos: fix inuse clamp when iocg deactivate or free

For an active leaf node, its inuse shouldn't be zero or exceed
its active, but it's not true when deactivate idle iocg or delete
iocg in ioc_pd_free().

Although inuse of 1 is very small, it could cause noticeable hwi
decrease in the long running server. So we'd better fix it.

And check iocg->child_active_sum is enough for inner iocg, remove
the needless list_empty check by the way.

Signed-off-by: Chengming Zhou <zhouchengming@...edance.com>
---
 block/blk-iocost.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index 2570732b92d1..84374ebcc402 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -1073,11 +1073,11 @@ static void __propagate_weights(struct ioc_gq *iocg, u32 active, u32 inuse,
 	 * @active. An active internal node's inuse is solely determined by the
 	 * inuse to active ratio of its children regardless of @inuse.
 	 */
-	if (list_empty(&iocg->active_list) && iocg->child_active_sum) {
+	if (iocg->child_active_sum) {
 		inuse = DIV64_U64_ROUND_UP(active * iocg->child_inuse_sum,
 					   iocg->child_active_sum);
 	} else {
-		inuse = clamp_t(u32, inuse, 1, active);
+		inuse = clamp_t(u32, inuse, 0, active);
 	}
 
 	iocg->last_inuse = iocg->inuse;
-- 
2.36.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ