Skip to contentSkip to conversation

hrtimer: migration: always subtract base->offset

tip:timers/urgent tip-bot for Thomas Gleixner 1 participant 1 message Jul 9, 2009

lore
Share & tools
lore
#0 lore raw
Commit-ID:  94d25649812b7d7055c162c7d910e94d3d213d34
Gitweb:     http://git.kernel.org/tip/94d25649812b7d7055c162c7d910e94d3d213d34
Author:     Thomas Gleixner <[email protected]>
AuthorDate: Thu, 9 Jul 2009 12:49:34 +0200
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Thu, 9 Jul 2009 13:58:06 +0200

hrtimer: migration: always subtract base->offset

The new timer migration code treats the !HIGHRES case special when calculating the CLOCK_MONOTONIC based expiry time to validate whether a timer should be enqueued on a different CPU or not.

This is wrong as a CLOCK_REALTIME based timer expiry value needs to be converted to CLOCK_MONOTONIC in any case.

Cc: Arun Bharadwaj <[email protected]
LKML-Reference: <new-submission>

---
 kernel/hrtimer.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
kernel/hrtimer.c +1 -6
index 9002958..0d43451 100644
@@ -236,13 +236,8 @@ again:
 		/* Optimized away for NOHZ=n SMP=n */
 		if (cpu == preferred_cpu) {
 			/* Calculate clock monotonic expiry time */
-#ifdef CONFIG_HIGH_RES_TIMERS
 			ktime_t expires = ktime_sub(hrtimer_get_expires(timer),
-							new_base->offset);
-#else
-			ktime_t expires = hrtimer_get_expires(timer);
-#endif
-
+						    new_base->offset);
 			/*
 			 * Get the next event on target cpu from the
 			 * clock events layer.