projects
/
profile
/
ivi
/
kernel-x86-ivi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5d2f5a6
)
sched: remove do_div() from __sched_slice()
author
Peter Zijlstra
<a.p.zijlstra@chello.nl>
Fri, 25 Jan 2008 20:08:21 +0000
(21:08 +0100)
committer
Ingo Molnar
<mingo@elte.hu>
Fri, 25 Jan 2008 20:08:21 +0000
(21:08 +0100)
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>
kernel/sched_fair.c
patch
|
blob
|
history
diff --git
a/kernel/sched_fair.c
b/kernel/sched_fair.c
index
2208692
..
10aa6e1
100644
(file)
--- a/
kernel/sched_fair.c
+++ b/
kernel/sched_fair.c
@@
-248,8
+248,8
@@
static u64 __sched_period(unsigned long nr_running)
unsigned long nr_latency = sched_nr_latency;
if (unlikely(nr_running > nr_latency)) {
+ period = sysctl_sched_min_granularity;
period *= nr_running;
- do_div(period, nr_latency);
}
return period;