On Thu, Aug 02, 2012 at 04:46:44AM -0600, Liu Bo wrote: > On 08/02/2012 04:25 AM, Josef Bacik wrote: > > We need an smb_mb() before waitqueue_active to avoid missing wakeups. > > Before Mitch was hitting a deadlock between the ordered flushers and the > > transaction commit because the ordered flushers were waiting for more refs > > and were never woken up, so those smp_mb()'s are the most important. > > Everything else I added for correctness sake and to avoid getting bitten by > > this again somewhere else. Thanks, > > > > Hi Josef, > > I'll appreciate a lot if you can add some comments for each memory > barrier, because not everyone knows why it is used here and there. :) >
I'm not going to add comments to all those places, you need a memory barrier in places you don't have an implicit barrier before you do waitqueue_active because you could miss somebody being added to the waitqueue, it's just basic correctness. Thanks, Josef -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
