Since it's set under pi_lock and cleared under rq->lock, these both are not synchronized.
Put move "woken_while_running = 1" in ttwu_remote(), where rq lock is held. Signed-off-by: Kirill Tkhai <[email protected]> --- kernel/sched/core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index c8ac8bd..f61a4d1 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1616,6 +1616,7 @@ static int ttwu_remote(struct task_struct *p, int wake_flags) rq = __task_rq_lock(p); if (p->on_rq) { ttwu_do_wakeup(rq, p, wake_flags); + p->woken_while_running = 1; ret = 1; } __task_rq_unlock(rq); @@ -1739,10 +1740,8 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) success = 1; /* we're going to change ->state */ cpu = task_cpu(p); - if (p->on_rq && ttwu_remote(p, wake_flags)) { - p->woken_while_running = 1; + if (p->on_rq && ttwu_remote(p, wake_flags)) goto stat; - } #ifdef CONFIG_SMP /* _______________________________________________ Devel mailing list [email protected] https://lists.openvz.org/mailman/listinfo/devel
