sched/core: Better document the try_to_wake_up() barriers
[firefly-linux-kernel-4.4.55.git] / kernel / sched / core.c
index eee4ee655db2854a7f85090346ca1987b2c36f5f..b64f163d512cbc4adb1477d7d493fd78b3571be2 100644 (file)
@@ -1953,7 +1953,13 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
        while (p->on_cpu)
                cpu_relax();
        /*
-        * Pairs with the smp_wmb() in finish_lock_switch().
+        * Combined with the control dependency above, we have an effective
+        * smp_load_acquire() without the need for full barriers.
+        *
+        * Pairs with the smp_store_release() in finish_lock_switch().
+        *
+        * This ensures that tasks getting woken will be fully ordered against
+        * their previous state and preserve Program Order.
         */
        smp_rmb();