Skip to content

Commit

Permalink
hrtimer: optimize the softirq time optimization
Browse files Browse the repository at this point in the history
The previous optimization did not take the case into account where a
clock provides its own softirq_get_time() function.

Check for the availablitiy of the clock get time function first and
then check if we need to retrieve the time for both clocks via
hrtimer_softirq_gettime() to avoid a double evaluation of time in that
case as well.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Thomas Gleixner committed Apr 21, 2008
1 parent 833883d commit 259aae8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions kernel/hrtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1254,14 +1254,13 @@ void hrtimer_run_queues(void)
if (!base->first)
continue;

if (gettime) {
if (base->get_softirq_time)
base->softirq_time = base->get_softirq_time();
else if (gettime) {
hrtimer_get_softirq_time(cpu_base);
gettime = 0;
}

if (base->get_softirq_time)
base->softirq_time = base->get_softirq_time();

spin_lock(&cpu_base->lock);

while ((node = base->first)) {
Expand Down

0 comments on commit 259aae8

Please sign in to comment.