mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch] high-res timers: next_event calculation fix
@ 2006-12-09 11:36 Ingo Molnar
  0 siblings, 0 replies; only message in thread
From: Ingo Molnar @ 2006-12-09 11:36 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Thomas Gleixner, linux-kernel

Subject: [patch] high-res timers: next_event calculation fix
From: Ingo Molnar <mingo@elte.hu>

do not set expires_next to KTIME_MAX if a too short timeout
is being set - this can result in the clock events device
being shut down completely.

found via a stresstest on a C3-lapic-plagued laptop that did
very short sleeps.

This bug could explain the 'Synaptics hang' that was reported.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/time/clockevents.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Index: linux/kernel/time/clockevents.c
===================================================================
--- linux.orig/kernel/time/clockevents.c
+++ linux/kernel/time/clockevents.c
@@ -510,10 +510,8 @@ int clockevents_set_next_event(ktime_t e
 	struct clock_event_device *nextevt = devices->nextevt;
 	int64_t delta = ktime_to_ns(ktime_sub(expires, ktime_get()));
 
-	if (delta <= 0 && !force) {
-		devices->expires_next.tv64 = KTIME_MAX;
+	if (delta <= 0 && !force)
 		return -ETIME;
-	}
 
 	devices->expires_next = expires;
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-12-09 11:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-09 11:36 [patch] high-res timers: next_event calculation fix Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®