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:	Fri, 27 Mar 2009 21:49:15 +0530
From:	Dhaval Giani <dhaval@...ux.vnet.ibm.com>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Ingo Molnar <mingo@...e.hu>
Cc:	Bharata B Rao <bharata@...ux.vnet.ibm.com>,
	Balbir Singh <balbir@...ibm.com>,
	Srivatsa Vaddagiri <vatsa@...ux.vnet.ibm.com>,
	Gautham Shenoy <ego@...ibm.com>,
	lkml <linux-kernel@...r.kernel.org>
Subject: [PATCH] sched: rt group scheduling, compare child's limit against
	parent's

Hi Ingo, Peter,

I've not been able to follow the reasoning behind checking the sum of
the children's runtime not exceeding the parent's runtime as opposed to
the child's runtime not exceeding that of the parent.

>From what I understand, the limits only guarantee that the group cannot
exceed a certain limit and not guarantee a group gets to run. If my
understanding is corrct, maybe the following patch is needed?

Thanks,

--
sched: rt group scheduling, compare child's limit against parent's

The current logic checks that the sum of the children's runtime in rt
group scheduling does not exceed the parent's. This logic is wrong,
all we claim is that the group cannot exceed the amount of time allowed.

Change the code to reflect this.

Signed-off-by: Dhaval Giani <dhaval@...ux.vnet.ibm.com>
---
 kernel/sched.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Index: linux-2.6/kernel/sched.c
===================================================================
--- linux-2.6.orig/kernel/sched.c
+++ linux-2.6/kernel/sched.c
@@ -9601,7 +9601,7 @@ static int tg_schedulable(struct task_gr
 {
 	struct rt_schedulable_data *d = data;
 	struct task_group *child;
-	unsigned long total, sum = 0;
+	unsigned long total;
 	u64 period, runtime;
 
 	period = ktime_to_ns(tg->rt_bandwidth.rt_period);
@@ -9640,9 +9640,10 @@ static int tg_schedulable(struct task_gr
 		return -EINVAL;
 
 	/*
-	 * The sum of our children's runtime should not exceed our own.
+	 * The child's runtime should not exceed our own.
 	 */
 	list_for_each_entry_rcu(child, &tg->children, siblings) {
+		unsigned long ratio;
 		period = ktime_to_ns(child->rt_bandwidth.rt_period);
 		runtime = child->rt_bandwidth.rt_runtime;
 
@@ -9651,11 +9652,11 @@ static int tg_schedulable(struct task_gr
 			runtime = d->rt_runtime;
 		}
 
-		sum += to_ratio(period, runtime);
-	}
+		ratio = to_ratio(period, runtime);
 
-	if (sum > total)
-		return -EINVAL;
+		if (ratio > total)
+			return -EINVAL;
+	}
 
 	return 0;
 }
-- 
regards,
Dhaval
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ