summaryrefslogtreecommitdiff
path: root/kernel/sched
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-12-13 20:42:19 (GMT)
committerScott Wood <scottwood@freescale.com>2015-02-13 22:20:33 (GMT)
commit30bebd246533c848a9215d2d6c559dacef298059 (patch)
tree7c5e11bf137d248aa9e270b76ada6c7e48319162 /kernel/sched
parentb4d193baf7fdb0a7ff314030fa514345ee0211c6 (diff)
downloadlinux-fsl-qoriq-30bebd246533c848a9215d2d6c559dacef298059.tar.xz
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')
-rw-r--r--kernel/sched/core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 29ec887..8f1e42e 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1511,8 +1511,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;
}