Re: RCU: Number of grace-periods

From: Dmitriy V'jukov
Date: Wed Mar 11 2009 - 13:51:00 EST


Paul E. McKenney <paulmck <at> linux.vnet.ibm.com> writes:
>
> Interesting thought -- but please keep in mind that acquire/release fences
> still allow subsequent stores to be reordered to precede earlier loads.
> This means that the first loads in the RCU critical section could be
> reordered to precede the final store of the rcu_read_lock() primitive.


Hmmm... Yes, I've missed this moment. I think you are right. The critical
synchronizing action of the __rcu_read_lock() is the store to the
__get_cpu_var(rcu_flipctr) (not a load!). So some code from the critical section
can hoist above the store to the __get_cpu_var(rcu_flipctr).
However the good question is how many grace-periods is required if code can
hoist above read_lock(), but can't sink below read_unlock()?
Good work for Relacy :) Nope, I've not yet tried to apply it...


--
Best regards,
Dmitriy V'jukov

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/