The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] timers: consider slack value in mod_timer()
Date: Sat, 21 May 2011 12:58:28 +0200	[thread overview]
Message-ID: <20110521105828.GA29442@Chamillionaire.breakpoint.cc> (raw)

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


             reply	other threads:[~2011-05-21 10:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-21 10:58 Sebastian Andrzej Siewior [this message]
2011-05-24  7:54 ` [PATCH] timers: consider slack value in mod_timer() 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110521105828.GA29442@Chamillionaire.breakpoint.cc \
    --to=sebastian@breakpoint.cc \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox