Re: [PATCH] btrfs: Remove memory barrier from block_group_cache_done

2017-09-25 Thread David Sterba
On Wed, Aug 30, 2017 at 07:35:42PM +0300, Nikolay Borisov wrote:
> This memory barrier was introduced in 817d52f8dba2 ("Btrfs: async block group
> caching"), but even at that time it's usage was broken since it didn't pair
> with anything. There was one situation where the cached member was set to
> BTRFS_CACHE_FINISHED in a spinlock region which *might* have acted as a 
> pairing
> barrier. Since there is no clear semantics how it's supposed to work better
> to just remove it.
> 
> Signed-off-by: Nikolay Borisov 

As discussed offline, this needs a better description that removing the
barrier will not break it.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] btrfs: Remove memory barrier from block_group_cache_done

2017-08-30 Thread Nikolay Borisov
This memory barrier was introduced in 817d52f8dba2 ("Btrfs: async block group
caching"), but even at that time it's usage was broken since it didn't pair
with anything. There was one situation where the cached member was set to
BTRFS_CACHE_FINISHED in a spinlock region which *might* have acted as a pairing
barrier. Since there is no clear semantics how it's supposed to work better
to just remove it.

Signed-off-by: Nikolay Borisov 
---
 fs/btrfs/extent-tree.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 21c78c48e15b..10c2ef1a9fd2 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -112,7 +112,6 @@ static void space_info_add_old_bytes(struct btrfs_fs_info 
*fs_info,
 static noinline int
 block_group_cache_done(struct btrfs_block_group_cache *cache)
 {
-   smp_mb();
return cache->cached == BTRFS_CACHE_FINISHED ||
cache->cached == BTRFS_CACHE_ERROR;
 }
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html