All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] timers: consider slack value in mod_timer()
@ 2011-05-21 10:58 Sebastian Andrzej Siewior
  2011-05-24  7:54 ` Yong Zhang
  2011-06-03 13:06 ` [tip:timers/urgent] timers: Consider " tip-bot for Sebastian Andrzej Siewior
  0 siblings, 2 replies; 8+ messages in thread
From: Sebastian Andrzej Siewior @ 2011-05-21 10:58 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: linux-kernel

There is an optimization which does not update the timer if the timer
was pending and the expiration time was unchanged.
Since commit 3bbb9ec9 ("timers: Introduce the concept of timer slack for
legacy timers") this optimization is no longer applied for timers where
the expiration time got extended due to the slack value. So here it adds
the check again after the expiration time might have been updated.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
---
 kernel/timer.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kernel/timer.c b/kernel/timer.c
index fd61986..bf09726 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -804,6 +804,8 @@ int mod_timer(struct timer_list *timer, unsigned long expires)
 		return 1;
 
 	expires = apply_slack(timer, expires);
+	if (timer_pending(timer) && timer->expires == expires)
+		return 1;
 
 	return __mod_timer(timer, expires, false, TIMER_NOT_PINNED);
 }
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-06-03 13:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-21 10:58 [PATCH] timers: consider slack value in mod_timer() Sebastian Andrzej Siewior
2011-05-24  7:54 ` Yong Zhang
2011-05-24 12:13   ` Sebastian Andrzej Siewior
2011-05-25  8:35     ` Yong Zhang
2011-05-25 10:17       ` Thomas Gleixner
2011-05-25 10:57         ` Thomas Gleixner
2011-05-26  6:19         ` Yong Zhang
2011-06-03 13:06 ` [tip:timers/urgent] timers: Consider " tip-bot for Sebastian Andrzej Siewior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.