Btrfs: barrier before waitqueue_active
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, Signed-off-by: Josef Bacik <jbacik@fusionio.com>
This commit is contained in:

committato da
Chris Mason

parent
1fa11e265f
commit
66657b318e
@@ -227,9 +227,8 @@ loop_lock:
|
||||
cur = pending;
|
||||
pending = pending->bi_next;
|
||||
cur->bi_next = NULL;
|
||||
atomic_dec(&fs_info->nr_async_bios);
|
||||
|
||||
if (atomic_read(&fs_info->nr_async_bios) < limit &&
|
||||
if (atomic_dec_return(&fs_info->nr_async_bios) < limit &&
|
||||
waitqueue_active(&fs_info->async_submit_wait))
|
||||
wake_up(&fs_info->async_submit_wait);
|
||||
|
||||
|
Fai riferimento in un nuovo problema
Block a user