Commit 8bdec955b0da2ffbd10eb9b200651dd1f9e366f2
Committed by
Ingo Molnar
1 parent
fe0bdec68b
Exists in
master
and in
39 other branches
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>
Showing 1 changed file with 17 additions and 7 deletions Side-by-side Diff
kernel/hrtimer.c
... | ... | @@ -1243,6 +1243,22 @@ |
1243 | 1243 | } |
1244 | 1244 | } |
1245 | 1245 | |
1246 | +/* | |
1247 | + * local version of hrtimer_peek_ahead_timers() called with interrupts | |
1248 | + * disabled. | |
1249 | + */ | |
1250 | +static 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 | 1263 | * hrtimer_peek_ahead_timers -- run soft-expired timers now |
1248 | 1264 | * |
1249 | 1265 | |
1250 | 1266 | |
... | ... | @@ -1254,16 +1270,10 @@ |
1254 | 1270 | */ |
1255 | 1271 | void hrtimer_peek_ahead_timers(void) |
1256 | 1272 | { |
1257 | - struct tick_device *td; | |
1258 | 1273 | unsigned long flags; |
1259 | 1274 | |
1260 | - if (!hrtimer_hres_active()) | |
1261 | - return; | |
1262 | - | |
1263 | 1275 | local_irq_save(flags); |
1264 | - td = &__get_cpu_var(tick_cpu_device); | |
1265 | - if (td && td->evtdev) | |
1266 | - hrtimer_interrupt(td->evtdev); | |
1276 | + __hrtimer_peek_ahead_timers(); | |
1267 | 1277 | local_irq_restore(flags); |
1268 | 1278 | } |
1269 | 1279 |