Re: [PATCH] btrfs: fix waitqueue_active without memory barrier in btrfs

2015-10-09 Thread David Sterba
On Fri, Oct 09, 2015 at 12:35:48AM +, Kosuke Tatsukawa wrote: > This patch removes the call to waitqueue_active() leaving just wake_up() > behind. This fixes the problem because the call to spin_lock_irqsave() > in wake_up() will be an ACQUIRE operation. Either we can switch it to wake_up or

[PATCH] btrfs: fix waitqueue_active without memory barrier in btrfs

2015-10-08 Thread Kosuke Tatsukawa
btrfs_bio_counter_sub() seems to be missing a memory barrier which might cause the waker to not notice the waiter and miss sending a wake_up as in the following figure. btrfs_bio_counter_sub btrfs_rm_dev_replace_blocked

Re: [PATCH] btrfs: fix waitqueue_active without memory barrier in btrfs

2015-10-08 Thread Kosuke Tatsukawa
Josef Bacik wrote: > On 10/08/2015 05:35 PM, Kosuke Tatsukawa wrote: >> btrfs_bio_counter_sub() seems to be missing a memory barrier which might >> cause the waker to not notice the waiter and miss sending a wake_up as >> in the following figure. >> >> btrfs_bio_counter_sub