summaryrefslogtreecommitdiff
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-12-13 21:42:19 +0100
committerClark Williams <williams@redhat.com>2011-12-28 16:25:39 -0600
commit7cc457f5c6561dc8b665e559b81c8eb09c6a5a15 (patch)
treebefda1fd164b4f764bb39b4c9862ce44bb1fcc06 /kernel/sched.c
parent48343dcfa37bce974c78d51d27cf3d96c4350eaa (diff)
sched: ttwu: Return success when only changing the saved_state value
When a task blocks on a rt lock, it saves the current state in p->saved_state, so a lock related wake up will not destroy the original state. When a real wakeup happens, while the task is running due to a lock wakeup already, we update p->saved_state to TASK_RUNNING, but we do not return success, which might cause another wakeup in the waitqueue code and the task remains in the waitqueue list. Return success in that case as well. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable-rt@vger.kernel.org
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 5b871cb17f95..a5a4ddc7ff7d 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2834,8 +2834,10 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
* if the wakeup condition is true.
*/
if (!(wake_flags & WF_LOCK_SLEEPER)) {
- if (p->saved_state & state)
+ if (p->saved_state & state) {
p->saved_state = TASK_RUNNING;
+ success = 1;
+ }
}
goto out;
}