diff options
| author | Davidlohr Bueso <[email protected]> | 2015-01-19 17:39:21 -0800 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2015-02-04 07:57:33 +0100 |
| commit | 51587bcf31d070119d37de6103543c807f5ccdb3 (patch) | |
| tree | f4d0686f20ce90cad1a57aea2f752097e4263595 /kernel | |
| parent | 2622e849a1d3d3ef531d1cc33308bb7fd00eee40 (diff) | |
locking/mutex: Explicitly mark task as running after wakeup
By the time we wake up and get the lock after being asleep
in the slowpath, we better be running. As good practice,
be explicit about this and avoid any mischief.
Signed-off-by: Davidlohr Bueso <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: "Paul E. McKenney" <[email protected]>
Cc: Linus Torvalds <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/locking/mutex.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c index c67a60b61625..57407062e209 100644 --- a/kernel/locking/mutex.c +++ b/kernel/locking/mutex.c @@ -587,6 +587,8 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, schedule_preempt_disabled(); spin_lock_mutex(&lock->wait_lock, flags); } + __set_task_state(task, TASK_RUNNING); + mutex_remove_waiter(lock, &waiter, current_thread_info()); /* set it to 0 if there are no waiters left: */ if (likely(list_empty(&lock->wait_list))) |