All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] timer: Fix jiffies wrap behavior of round_jiffies*()
@ 2013-05-21 18:43 Bart Van Assche
  2013-05-29 23:01 ` Andrew Morton
  2013-06-28 15:12 ` [tip:timers/core] timer: Fix jiffies wrap behavior of round_jiffies_common() tip-bot for Bart Van Assche
  0 siblings, 2 replies; 9+ messages in thread
From: Bart Van Assche @ 2013-05-21 18:43 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Arjan van de Ven, Stephen Rothwell, linux-kernel

Make sure that the round_jiffies*() functions return a time that is
in the future when the jiffies counter is about to wrap.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
---
 kernel/timer.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/timer.c b/kernel/timer.c
index 15ffdb3..aa8b964 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -149,9 +149,7 @@ static unsigned long round_jiffies_common(unsigned long j, int cpu,
 	/* now that we have rounded, subtract the extra skew again */
 	j -= cpu * 3;
-	if (j <= jiffies) /* rounding ate our timeout entirely; */
-		return original;
-	return j;
+	return time_is_after_jiffies(j) ? j : original;
 }
  /**
-- 
1.7.10.4


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

end of thread, other threads:[~2013-06-28 15:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-21 18:43 [PATCH] timer: Fix jiffies wrap behavior of round_jiffies*() Bart Van Assche
2013-05-29 23:01 ` Andrew Morton
2013-05-29 23:17   ` Joe Perches
2013-05-29 23:38     ` Andrew Morton
2013-05-29 23:48       ` Joe Perches
2013-05-30  0:13       ` Joe Perches
2013-05-30  4:50         ` Andrew Morton
2013-05-30  6:19   ` Bart Van Assche
2013-06-28 15:12 ` [tip:timers/core] timer: Fix jiffies wrap behavior of round_jiffies_common() tip-bot for Bart Van Assche

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.