[PATCH] clockevents: avoid unnecessary reprograming of event timer

From: Michael Davidson
Date: Thu Feb 12 2009 - 17:23:47 EST


From: Michael Davidson <md@xxxxxxxxxx>

Don't reprogram the event timer if it is already set to expire
at the correct time.

Signed-off-by: Michael Davidson <md@xxxxxxxxxx>
---
--- linux-2.6.29-rc4.orig/kernel/time/clockevents.c 2009-02-12 13:13:24.000000000 -0800
+++ linux-2.6.29-rc4/kernel/time/clockevents.c 2009-02-12 13:25:42.525558000 -0800
@@ -103,6 +103,9 @@
if (delta <= 0)
return -ETIME;

+ if (ktime_equal(dev->next_event, expires))
+ return 0;
+
dev->next_event = expires;

if (dev->mode == CLOCK_EVT_MODE_SHUTDOWN)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/