Re: [PATCH v7 2/6] MCS Lock: optimizations and extra comments

2014-01-20 Thread Tim Chen
On Mon, 2014-01-20 at 14:58 +0100, Peter Zijlstra wrote: > On Thu, Jan 16, 2014 at 04:08:20PM -0800, Tim Chen wrote: > > Remove unnecessary operation and make the cmpxchg(lock, node, NULL) == node > > check in mcs_spin_unlock() likely() as it is likely that a race did not > > occur > > most of the

Re: [PATCH v7 2/6] MCS Lock: optimizations and extra comments

2014-01-20 Thread Peter Zijlstra
On Thu, Jan 16, 2014 at 04:08:20PM -0800, Tim Chen wrote: > Remove unnecessary operation and make the cmpxchg(lock, node, NULL) == node > check in mcs_spin_unlock() likely() as it is likely that a race did not occur > most of the time. It might be good to describe why the node->locked=1 is thought

Re: [PATCH v7 2/6] MCS Lock: optimizations and extra comments

2014-01-19 Thread Paul E. McKenney
On Thu, Jan 16, 2014 at 04:08:20PM -0800, Tim Chen wrote: > Remove unnecessary operation and make the cmpxchg(lock, node, NULL) == node > check in mcs_spin_unlock() likely() as it is likely that a race did not occur > most of the time. > > Also add in more comments describing how the local node is

[PATCH v7 2/6] MCS Lock: optimizations and extra comments

2014-01-16 Thread Tim Chen
Remove unnecessary operation and make the cmpxchg(lock, node, NULL) == node check in mcs_spin_unlock() likely() as it is likely that a race did not occur most of the time. Also add in more comments describing how the local node is used in MCS locks. From: Jason Low Reviewed-by: Tim Chen Signed-