aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-01-05 05:28:19 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-05 07:14:32 -0500
commit8bdec955b0da2ffbd10eb9b200651dd1f9e366f2 (patch)
tree8f44e541adf7e6110f064ed70e9f0751be98be95
parentfe0bdec68b77020281dc814805edfe594ae89e0f (diff)
hrtimer: splitout peek ahead functionality
Impact: cleanup Provide a peek ahead function that assumes irqs disabled, allows for micro optimizations. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--kernel/hrtimer.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index eb2bfefa6dcc..8f7001c97e06 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1243,6 +1243,22 @@ void hrtimer_interrupt(struct clock_event_device *dev)
1243 } 1243 }
1244} 1244}
1245 1245
1246/*
1247 * local version of hrtimer_peek_ahead_timers() called with interrupts
1248 * disabled.
1249 */
1250static void __hrtimer_peek_ahead_timers(void)
1251{
1252 struct tick_device *td;
1253
1254 if (!hrtimer_hres_active())
1255 return;
1256
1257 td = &__get_cpu_var(tick_cpu_device);
1258 if (td && td->evtdev)
1259 hrtimer_interrupt(td->evtdev);
1260}
1261
1246/** 1262/**
1247 * hrtimer_peek_ahead_timers -- run soft-expired timers now 1263 * hrtimer_peek_ahead_timers -- run soft-expired timers now
1248 * 1264 *
@@ -1254,16 +1270,10 @@ void hrtimer_interrupt(struct clock_event_device *dev)
1254 */ 1270 */
1255void hrtimer_peek_ahead_timers(void) 1271void hrtimer_peek_ahead_timers(void)
1256{ 1272{
1257 struct tick_device *td;
1258 unsigned long flags; 1273 unsigned long flags;
1259 1274
1260 if (!hrtimer_hres_active())
1261 return;
1262
1263 local_irq_save(flags); 1275 local_irq_save(flags);
1264 td = &__get_cpu_var(tick_cpu_device); 1276 __hrtimer_peek_ahead_timers();
1265 if (td && td->evtdev)
1266 hrtimer_interrupt(td->evtdev);
1267 local_irq_restore(flags); 1277 local_irq_restore(flags);
1268} 1278}
1269 1279