summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-07-17 22:08:38 +0200
committerClark Williams <williams@redhat.com>2012-04-13 11:01:42 -0500
commit197fe591ae44f5f63931b769502d9b83db0787c1 (patch)
tree06b54d3eb0995eb683ead4be3b162010094988f8 /kernel
parent107adcf7747c840b097394477109d4b41a46d970 (diff)
timer-handle-idle-trylock-in-get-next-timer-irq.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rtmutex.c7
-rw-r--r--kernel/timer.c7
2 files changed, 5 insertions, 9 deletions
diff --git a/kernel/rtmutex.c b/kernel/rtmutex.c
index f9baaaef1184..921c90b8d188 100644
--- a/kernel/rtmutex.c
+++ b/kernel/rtmutex.c
@@ -861,15 +861,10 @@ EXPORT_SYMBOL(rt_spin_unlock_wait);
int __lockfunc rt_spin_trylock(spinlock_t *lock)
{
- int ret;
+ int ret = rt_mutex_trylock(&lock->lock);
- migrate_disable();
- ret = rt_mutex_trylock(&lock->lock);
if (ret)
spin_acquire(&lock->dep_map, 0, 1, _RET_IP_);
- else
- migrate_enable();
-
return ret;
}
EXPORT_SYMBOL(rt_spin_trylock);
diff --git a/kernel/timer.c b/kernel/timer.c
index cc2588bb2583..f6f2958ad606 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1373,13 +1373,14 @@ unsigned long get_next_timer_interrupt(unsigned long now)
/*
* On PREEMPT_RT we cannot sleep here. If the trylock does not
* succeed then we return the worst-case 'expires in 1 tick'
- * value:
+ * value. We use the rt functions here directly to avoid a
+ * migrate_disable() call.
*/
- if (spin_trylock(&base->lock)) {
+ if (spin_do_trylock(&base->lock)) {
if (time_before_eq(base->next_timer, base->timer_jiffies))
base->next_timer = __next_timer_interrupt(base);
expires = base->next_timer;
- spin_unlock(&base->lock);
+ rt_spin_unlock(&base->lock);
} else {
expires = now + 1;
}