lkml.org 
[lkml]   [2016]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] sched: Assign !p->on_cpu to the second parameter of smp_cond_load_acquire()
The second parameter of smp_cond_load_acquire() should be !p->on_cpu
cause remote wakeup need to ensure that: if the task is running on
prev cpu, it should be descheduled before doing the actual wakeup.

Signed-off-by: T.Zhou <t1zhou@163.com>
---
kernel/sched/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 3387e4f..8e6fef6 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2047,7 +2047,7 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
* This ensures that tasks getting woken will be fully ordered against
* their previous state and preserve Program Order.
*/
- smp_cond_load_acquire(&p->on_cpu, !VAL);
+ smp_cond_load_acquire(&p->on_cpu, !p->on_cpu);

p->sched_contributes_to_load = !!task_contributes_to_load(p);
p->state = TASK_WAKING;
--
2.7.3
\
 
 \ /
  Last update: 2016-07-01 06:21    [W:0.037 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site