diff options
author | Peter Zijlstra <peterz@infradead.org> | 2015-10-06 14:36:17 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-12-04 10:26:42 +0100 |
commit | b75a22531588e77aa8c2daf228c9723916ae2cd0 (patch) | |
tree | 410014f762b59ea5dd46e4f58b1f1a4728a01c4a /kernel/sched/sched.h | |
parent | 2541117b0cf79977fa11a0d6e17d61010677bd7b (diff) | |
download | op-kernel-dev-b75a22531588e77aa8c2daf228c9723916ae2cd0.zip op-kernel-dev-b75a22531588e77aa8c2daf228c9723916ae2cd0.tar.gz |
sched/core: Better document the try_to_wake_up() barriers
Explain how the control dependency and smp_rmb() end up providing
ACQUIRE semantics and pair with smp_store_release() in
finish_lock_switch().
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/sched.h')
-rw-r--r-- | kernel/sched/sched.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index efd3bfc..b242775 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1073,6 +1073,9 @@ static inline void finish_lock_switch(struct rq *rq, struct task_struct *prev) * We must ensure this doesn't happen until the switch is completely * finished. * + * In particular, the load of prev->state in finish_task_switch() must + * happen before this. + * * Pairs with the control dependency and rmb in try_to_wake_up(). */ smp_store_release(&prev->on_cpu, 0); |