Re: [PATCH 2/4] sched: Document Program-Order guarantees

Peter Zijlstra
2015-11-02T22:12:33Z

On Mon, Nov 02, 2015 at 02:09:20PM -0800, Paul Turner wrote:
> If we went this route, we could do something like:
>
> + * So in this case the scheduler does not provide an obvious full barrier; but
> + * the smp_store_release() in finish_lock_switch(), paired with the control-dep
> + * and smp_rmb() in try_to_wake_up() form a release-acquire pair and fully
> + * order things between CPU0 and CPU1.
>
> Instead of having this, which is complete, but hard to synchronize
> with the points at which it actually matters. Just use acquire and
> release above, then at the actual site, e.g. in try_to_wake_up()
> document how we deliver the acquire required by the higher level
> documentation/requirements.

Right, which was most of the point of trying to introduce
smp_cond_acquire(), abstract out the tricky cond-dep and rmb trickery
so we can indeed talk about release+acquire like normal people ;-)