aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2008-01-25 15:08:21 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-25 15:08:21 -0500
commit4bf0b77158d581c952af237aec79d0604b78fe27 (patch)
treed2500b882a4ed7e9a97e8633120a6e6aeccfa0c3 /kernel
parent5d2f5a616d65e3c08acde3195694c4ab8afbc1b7 (diff)
sched: remove do_div() from __sched_slice()
Yanmin Zhang noticed a nice optimization: p = l * nr / nl, nl = l/g -> p = g * nr which eliminates a do_div() from __sched_period(). Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched_fair.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 2208692dc4a0..10aa6e1ae3dd 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -248,8 +248,8 @@ static u64 __sched_period(unsigned long nr_running)
248 unsigned long nr_latency = sched_nr_latency; 248 unsigned long nr_latency = sched_nr_latency;
249 249
250 if (unlikely(nr_running > nr_latency)) { 250 if (unlikely(nr_running > nr_latency)) {
251 period = sysctl_sched_min_granularity;
251 period *= nr_running; 252 period *= nr_running;
252 do_div(period, nr_latency);
253 } 253 }
254 254
255 return period; 255 return period;