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]
Message-Id: <20221011083547.1831389-5-yukuai1@huaweicloud.com>
Date:   Tue, 11 Oct 2022 16:35:46 +0800
From:   Yu Kuai <yukuai1@...weicloud.com>
To:     tj@...nel.org, axboe@...nel.dk
Cc:     linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
        yukuai3@...wei.com, yukuai1@...weicloud.com, yi.zhang@...wei.com
Subject: [PATCH -next 4/5] blk-iocost: bypass if only one cgroup issues io

From: Yu Kuai <yukuai3@...wei.com>

In this special case, there is no need to throttle io.

Signed-off-by: Yu Kuai <yukuai3@...wei.com>
---
 block/blk-iocost.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index 5acc5f13bbd6..32e7e416d67c 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -2564,8 +2564,13 @@ static void ioc_rqos_throttle(struct rq_qos *rqos, struct bio *bio)
 	bool use_debt, ioc_locked;
 	unsigned long flags;
 
-	/* bypass IOs if disabled, still initializing, or for root cgroup */
-	if (!ioc->enabled || !iocg || !iocg->level)
+	/*
+	 * bypass IOs if disabled, still initializing, for root cgroup,
+	 * or the cgroup is the only cgroup with io.
+	 */
+	if (!ioc->enabled || !iocg || !iocg->level ||
+	    (iocg->hweight_inuse == WEIGHT_ONE &&
+	     atomic_read(&ioc->hweight_gen) == iocg->hweight_gen))
 		return;
 
 	/* calculate the absolute vtime cost */
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ