Re: [PATCH v1 1/6] timer: make __next_timer_interrupt explicit about no future event
From: Frederic Weisbecker <hidden>
Date: 2012-05-04 12:20:19
Also in:
lkml
2012/5/4 Frederic Weisbecker [off-list ref]:
On Thu, May 03, 2012 at 05:55:57PM +0300, Gilad Ben-Yossef wrote:quoted
@@ -1317,9 +1322,15 @@ unsigned long get_next_timer_interrupt(unsigned long now)if (cpu_is_offline(smp_processor_id())) return now + NEXT_TIMER_MAX_DELTA; spin_lock(&base->lock); - if (time_before_eq(base->next_timer, base->timer_jiffies)) - base->next_timer = __next_timer_interrupt(base); - expires = base->next_timer; + if (time_before_eq(base->next_timer, base->timer_jiffies)) { + + if (__next_timer_interrupt(base, &expires)) + base->next_timer = expires; + else + expires = now + NEXT_TIMER_MAX_DELTA;I believe you can update base->next_timer to now + NEXT_TIMER_MAX_DELTA, so on any further idle interrupt exit that call tick_nohz_stop_sched_tick(), we won't get again the overhead of __next_timer_interrupt().
Ah forget that, I was confused. If we do that we actually get the useless timer at now + NEXT_TIMER_MAX_DELTA. So I think the patch is fine. Acked-by: Frederic Weisbecker <redacted> -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>