Re: [PATCH] Btrfs: barrier before waitqueue_active

2012-08-05 Thread Arne Jansen
On 08/03/2012 04:43 PM, Mitch Harder wrote: On Wed, Aug 1, 2012 at 7:21 PM, Mitch Harder mitch.har...@sabayonlinux.org wrote: On Wed, Aug 1, 2012 at 3:25 PM, Josef Bacik jba...@fusionio.com wrote: We need an smb_mb() before waitqueue_active to avoid missing wakeups. Before Mitch was hitting a

Re: [PATCH] Btrfs: barrier before waitqueue_active

2012-08-02 Thread Liu Bo
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

Re: [PATCH] Btrfs: barrier before waitqueue_active

2012-08-02 Thread Josef Bacik
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

Re: [PATCH] Btrfs: barrier before waitqueue_active

2012-08-02 Thread cwillu
On Thu, Aug 2, 2012 at 4:46 AM, Liu Bo liub.li...@gmail.com 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

Re: [PATCH] Btrfs: barrier before waitqueue_active

2012-08-02 Thread David Sterba
On Thu, Aug 02, 2012 at 08:11:58AM -0400, Josef Bacik wrote: 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

[PATCH] Btrfs: barrier before waitqueue_active V2

2012-08-02 Thread Josef Bacik
We need a barrir before calling waitqueue_active otherwise we will miss wakeups. So in places that do atomic_dec(); then atomic_read() use atomic_dec_return() which imply a memory barrier (see memory-barriers.txt) and then add an explicit memory barrier everywhere else that need them. Thanks,

[PATCH] Btrfs: barrier before waitqueue_active

2012-08-01 Thread Josef Bacik
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

Re: [PATCH] Btrfs: barrier before waitqueue_active

2012-08-01 Thread Mitch Harder
On Wed, Aug 1, 2012 at 3:25 PM, Josef Bacik jba...@fusionio.com 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