diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2008-01-25 15:08:29 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-25 15:08:29 -0500 |
commit | 8f4d37ec073c17e2d4aa8851df5837d798606d6f (patch) | |
tree | a9ac9063eca53e4d0110e8086f55241ea70ba993 /include/linux/hrtimer.h | |
parent | 02b67cc3ba36bdba351d6c3a00593f4ec550d9d3 (diff) |
sched: high-res preemption tick
Use HR-timers (when available) to deliver an accurate preemption tick.
The regular scheduler tick that runs at 1/HZ can be too coarse when nice
level are used. The fairness system will still keep the cpu utilisation 'fair'
by then delaying the task that got an excessive amount of CPU time but try to
minimize this by delivering preemption points spot-on.
The average frequency of this extra interrupt is sched_latency / nr_latency.
Which need not be higher than 1/HZ, its just that the distribution within the
sched_latency period is important.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/hrtimer.h')
-rw-r--r-- | include/linux/hrtimer.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 7a9398e1970..ecc8e2685e2 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -217,6 +217,11 @@ static inline ktime_t hrtimer_cb_get_time(struct hrtimer *timer) | |||
217 | return timer->base->get_time(); | 217 | return timer->base->get_time(); |
218 | } | 218 | } |
219 | 219 | ||
220 | static inline int hrtimer_is_hres_active(struct hrtimer *timer) | ||
221 | { | ||
222 | return timer->base->cpu_base->hres_active; | ||
223 | } | ||
224 | |||
220 | /* | 225 | /* |
221 | * The resolution of the clocks. The resolution value is returned in | 226 | * The resolution of the clocks. The resolution value is returned in |
222 | * the clock_getres() system call to give application programmers an | 227 | * the clock_getres() system call to give application programmers an |
@@ -248,6 +253,10 @@ static inline ktime_t hrtimer_cb_get_time(struct hrtimer *timer) | |||
248 | return timer->base->softirq_time; | 253 | return timer->base->softirq_time; |
249 | } | 254 | } |
250 | 255 | ||
256 | static inline int hrtimer_is_hres_active(struct hrtimer *timer) | ||
257 | { | ||
258 | return 0; | ||
259 | } | ||
251 | #endif | 260 | #endif |
252 | 261 | ||
253 | extern ktime_t ktime_get(void); | 262 | extern ktime_t ktime_get(void); |