Skip to content

Commit

Permalink
nohz: reduce jiffies polling overhead
Browse files Browse the repository at this point in the history
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Ingo Molnar committed May 30, 2008
1 parent 916941b commit 7a14ce1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kernel/time/tick-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ static void tick_do_update_jiffies64(ktime_t now)
unsigned long ticks = 0;
ktime_t delta;

/*
* Do a quick check without holding xtime_lock:
*/
delta = ktime_sub(now, last_jiffies_update);
if (delta.tv64 < tick_period.tv64)
return;

/* Reevalute with xtime_lock held */
write_seqlock(&xtime_lock);

Expand Down

0 comments on commit 7a14ce1

Please sign in to comment.