diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2006-12-10 05:21:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-10 12:57:22 -0500 |
commit | 4c36a5dec25fb344ad76b11860da3a8b50bd1248 (patch) | |
tree | facfe4ad3bb3638d8ee6f6b3e7fc75a0a02e304a /include | |
parent | 5466b456ed6748e0bfe02831e570004d4c04c1d7 (diff) |
[PATCH] round_jiffies infrastructure
Introduce a round_jiffies() function as well as a round_jiffies_relative()
function. These functions round a jiffies value to the next whole second.
The primary purpose of this rounding is to cause all "we don't care exactly
when" timers to happen at the same jiffy.
This avoids multiple timers firing within the second for no real reason;
with dynamic ticks these extra timers cause wakeups from deep sleep CPU
sleep states and thus waste power.
The exact wakeup moment is skewed by the cpu number, to avoid all cpus from
waking up at the exact same time (and hitting the same lock/cachelines
there)
[akpm@osdl.org: fix variable type]
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/timer.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/timer.h b/include/linux/timer.h index c982304dbafd..eeef6643d4c6 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -98,4 +98,10 @@ extern void run_local_timers(void); | |||
98 | struct hrtimer; | 98 | struct hrtimer; |
99 | extern int it_real_fn(struct hrtimer *); | 99 | extern int it_real_fn(struct hrtimer *); |
100 | 100 | ||
101 | unsigned long __round_jiffies(unsigned long j, int cpu); | ||
102 | unsigned long __round_jiffies_relative(unsigned long j, int cpu); | ||
103 | unsigned long round_jiffies(unsigned long j); | ||
104 | unsigned long round_jiffies_relative(unsigned long j); | ||
105 | |||
106 | |||
101 | #endif | 107 | #endif |