Skip to content

Commit

Permalink
hrtimer: splitout peek ahead functionality
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Jan 5, 2009
1 parent fe0bdec commit 8bdec95
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions kernel/hrtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,22 @@ void hrtimer_interrupt(struct clock_event_device *dev)
}
}

/*
* local version of hrtimer_peek_ahead_timers() called with interrupts
* disabled.
*/
static void __hrtimer_peek_ahead_timers(void)
{
struct tick_device *td;

if (!hrtimer_hres_active())
return;

td = &__get_cpu_var(tick_cpu_device);
if (td && td->evtdev)
hrtimer_interrupt(td->evtdev);
}

/**
* hrtimer_peek_ahead_timers -- run soft-expired timers now
*
Expand All @@ -1254,16 +1270,10 @@ void hrtimer_interrupt(struct clock_event_device *dev)
*/
void hrtimer_peek_ahead_timers(void)
{
struct tick_device *td;
unsigned long flags;

if (!hrtimer_hres_active())
return;

local_irq_save(flags);
td = &__get_cpu_var(tick_cpu_device);
if (td && td->evtdev)
hrtimer_interrupt(td->evtdev);
__hrtimer_peek_ahead_timers();
local_irq_restore(flags);
}

Expand Down

0 comments on commit 8bdec95

Please sign in to comment.