Commit:     935c631db827cc3a96df4dcc6fec374b994fdbd1
Parent:     de326dbe0c8b61b81aab32970236ee9ee47d782a
Author:     Ingo Molnar <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 28 13:17:18 2007 +0200
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Mar 28 13:44:31 2007 -0700

    [PATCH] hrtimers: fix reprogramming SMP race
    hrtimer_start() incorrectly set the 'reprogram' flag to enqueue_hrtimer(),
    which should only be 1 if the hrtimer is queued to the current CPU.
    Doing otherwise could result in a reprogramming of the current CPU's
    clockevents device, with a timer that is not queued to it - resulting in a
    bogus next expiry value.
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Cc: Michal Piotrowski <[EMAIL PROTECTED]>
    Acked-by: Thomas Gleixner <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 kernel/hrtimer.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 6a7938a..067ba2c 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -814,7 +814,12 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const 
enum hrtimer_mode mode)
-       enqueue_hrtimer(timer, new_base, base == new_base);
+       /*
+        * Only allow reprogramming if the new base is on this CPU.
+        * (it might still be on another CPU if the timer was pending)
+        */
+       enqueue_hrtimer(timer, new_base,
+                       new_base->cpu_base == &__get_cpu_var(hrtimer_bases));
        unlock_hrtimer_base(timer, &flags);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to