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: <40b42ff504ad8f54251ca4b8c088f217410aa791.1462923578.git.shli@fb.com>
Date:	Tue, 10 May 2016 17:16:39 -0700
From:	Shaohua Li <shli@...com>
To:	<linux-block@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC:	<tj@...nel.org>, <vgoyal@...hat.com>, <axboe@...com>,
	<jmoyer@...hat.com>, <Kernel-team@...com>
Subject: [PATCH 09/10] blk-throttle: make sure expire time isn't too big

cgroup could be throttled to a limit but when other cgroups are idle,
queue enters a higher state and so the group should be throttled to a
higher limit. It's possible the cgroup is sleeping because of throttle
and other cgroups don't dispatch IO any more. In this case, nobody can
trigger current downgrade/upgrade logic. To fix this issue, we could
either set up a timer to wakeup the cgroup if other cgroups are idle or
make sure this cgroup doesn't sleep too long. Setting up a timer means
we must change the timer very frequently. This patch chooses the latter.
Making cgroup sleep time not too big wouldn't change cgroup bps/iops,
but could make it wakeup more frequently, which isn't a big issue
because cg_check_time * 8 is already quite big.

Signed-off-by: Shaohua Li <shli@...com>
---
 block/blk-throttle.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index 0aed049..a5f3435 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -632,6 +632,9 @@ static void throtl_dequeue_tg(struct throtl_grp *tg)
 static void throtl_schedule_pending_timer(struct throtl_service_queue *sq,
 					  unsigned long expires)
 {
+	unsigned long max_expire = jiffies + 8 * cg_check_time;
+	if (time_after(expires, max_expire))
+		expires = max_expire;
 	mod_timer(&sq->pending_timer, expires);
 	throtl_log(sq, "schedule timer. delay=%lu jiffies=%lu",
 		   expires - jiffies, jiffies);
-- 
2.8.0.rc2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ