Commit 640f0c05 authored by Thomas Gleixner's avatar Thomas Gleixner

rtmutex: remove uber optimization

The adaptive spin patches introduced an overdesigned optimization for
the adaptive path. This avoidance of those code pathes is not worth
the extra conditionals and furthermore it is inconsistent in itself.

Remove it and use the same mechanism as the other lock pathes. That
way we have a consistent state manipulation scheme and less extra
cases.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent d5ad85bc
......@@ -770,7 +770,6 @@ rt_spin_lock_slowlock(struct rt_mutex *lock)
struct rt_mutex_waiter waiter;
unsigned long saved_state, flags;
struct task_struct *orig_owner;
int missed = 0;
debug_rt_mutex_init_waiter(&waiter);
waiter.task = NULL;
......@@ -791,19 +790,14 @@ rt_spin_lock_slowlock(struct rt_mutex *lock)
* about original state TASK_INTERRUPTIBLE as well, as we
* could miss a wakeup_interruptible()
*/
saved_state = current->state;
saved_state = rt_set_current_blocked_state(current->state);
for (;;) {
int saved_lock_depth = current->lock_depth;
/* Try to acquire the lock */
if (do_try_to_take_rt_mutex(lock, STEAL_LATERAL)) {
/* If we never blocked break out now */
if (!missed)
goto unlock;
if (do_try_to_take_rt_mutex(lock, STEAL_LATERAL))
break;
}
missed = 1;
/*
* waiter.task is NULL the first time we come here and
......@@ -832,12 +826,6 @@ rt_spin_lock_slowlock(struct rt_mutex *lock)
if (adaptive_wait(&waiter, orig_owner)) {
put_task_struct(orig_owner);
saved_state = rt_set_current_blocked_state(saved_state);
/*
* The xchg() in update_current() is an implicit
* barrier which we rely upon to ensure current->state
* is visible before we test waiter.task.
*/
if (waiter.task)
schedule_rt_mutex(lock);
} else
......@@ -845,6 +833,7 @@ rt_spin_lock_slowlock(struct rt_mutex *lock)
atomic_spin_lock_irqsave(&lock->wait_lock, flags);
current->lock_depth = saved_lock_depth;
saved_state = rt_set_current_blocked_state(saved_state);
}
rt_restore_current_state(saved_state);
......@@ -863,7 +852,6 @@ rt_spin_lock_slowlock(struct rt_mutex *lock)
*/
fixup_rt_mutex_waiters(lock);
unlock:
atomic_spin_unlock_irqrestore(&lock->wait_lock, flags);
debug_rt_mutex_free_waiter(&waiter);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment