From 5640d35450259a916b97a41908dacdb129dd4d86 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Wed, 27 Feb 2008 12:00:46 +0100 Subject: [PATCH] --- yaml --- r: 87034 b: refs/heads/master c: 2692a2406b9262bbb101708815be99ec2988e48b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/kernel/sched.c | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 1b5ade4d1285..e10a155dcfb9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1868f958eb56fc41c5985c8732e564a400c5fdf5 +refs/heads/master: 2692a2406b9262bbb101708815be99ec2988e48b diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 5b13e4b0e009..b8ee864c7481 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -7726,9 +7726,7 @@ static unsigned long to_ratio(u64 period, u64 runtime) if (runtime == RUNTIME_INF) return 1ULL << 16; - runtime *= (1ULL << 16); - div64_64(runtime, period); - return runtime; + return div64_64(runtime << 16, period); } static int __rt_schedulable(struct task_group *tg, u64 period, u64 runtime) @@ -7757,18 +7755,16 @@ int sched_group_set_rt_runtime(struct task_group *tg, long rt_runtime_us) u64 rt_runtime, rt_period; int err = 0; - rt_period = sysctl_sched_rt_period * NSEC_PER_USEC; + rt_period = (u64)sysctl_sched_rt_period * NSEC_PER_USEC; rt_runtime = (u64)rt_runtime_us * NSEC_PER_USEC; if (rt_runtime_us == -1) - rt_runtime = rt_period; + rt_runtime = RUNTIME_INF; mutex_lock(&rt_constraints_mutex); if (!__rt_schedulable(tg, rt_period, rt_runtime)) { err = -EINVAL; goto unlock; } - if (rt_runtime_us == -1) - rt_runtime = RUNTIME_INF; tg->rt_runtime = rt_runtime; unlock: mutex_unlock(&rt_constraints_mutex);