From 60255be7bbf01bcbe6d743e62b22145b0902e345 Mon Sep 17 00:00:00 2001 From: "akpm@osdl.org" Date: Wed, 1 Feb 2006 03:05:10 -0800 Subject: [PATCH] --- yaml --- r: 19348 b: refs/heads/master c: ff60a5dc4fa584d47022d2533bc5c53b80096fb5 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/hrtimer.h | 1 + trunk/kernel/hrtimer.c | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 78fc746fa378..4a418f9995e1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a16a1c095a2392d49fafea22f3a508e268ef7167 +refs/heads/master: ff60a5dc4fa584d47022d2533bc5c53b80096fb5 diff --git a/trunk/include/linux/hrtimer.h b/trunk/include/linux/hrtimer.h index 089bfb1fa01a..c657f3d4924a 100644 --- a/trunk/include/linux/hrtimer.h +++ b/trunk/include/linux/hrtimer.h @@ -40,6 +40,7 @@ enum hrtimer_restart { enum hrtimer_state { HRTIMER_INACTIVE, /* Timer is inactive */ HRTIMER_EXPIRED, /* Timer is expired */ + HRTIMER_RUNNING, /* Timer is running the callback function */ HRTIMER_PENDING, /* Timer is pending */ }; diff --git a/trunk/kernel/hrtimer.c b/trunk/kernel/hrtimer.c index f1c4155b49ac..f580dd9db286 100644 --- a/trunk/kernel/hrtimer.c +++ b/trunk/kernel/hrtimer.c @@ -550,6 +550,7 @@ static inline void run_hrtimer_queue(struct hrtimer_base *base) fn = timer->function; data = timer->data; set_curr_timer(base, timer); + timer->state = HRTIMER_RUNNING; __remove_hrtimer(timer, base); spin_unlock_irq(&base->lock); @@ -565,6 +566,10 @@ static inline void run_hrtimer_queue(struct hrtimer_base *base) spin_lock_irq(&base->lock); + /* Another CPU has added back the timer */ + if (timer->state != HRTIMER_RUNNING) + continue; + if (restart == HRTIMER_RESTART) enqueue_hrtimer(timer, base); else