* [PATCH] btrfs: Remove memory barrier from block_group_cache_done
@ 2017-08-30 16:35 Nikolay Borisov
2017-09-25 14:08 ` David Sterba
0 siblings, 1 reply; 2+ messages in thread
From: Nikolay Borisov @ 2017-08-30 16:35 UTC (permalink / raw)
To: dsterba; +Cc: linux-btrfs, josef, 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 <nborisov@suse.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] btrfs: Remove memory barrier from block_group_cache_done
2017-08-30 16:35 [PATCH] btrfs: Remove memory barrier from block_group_cache_done Nikolay Borisov
@ 2017-09-25 14:08 ` David Sterba
0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2017-09-25 14:08 UTC (permalink / raw)
To: Nikolay Borisov; +Cc: dsterba, linux-btrfs, josef
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 <nborisov@suse.com>
As discussed offline, this needs a better description that removing the
barrier will not break it.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-25 14:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-30 16:35 [PATCH] btrfs: Remove memory barrier from block_group_cache_done Nikolay Borisov
2017-09-25 14:08 ` David Sterba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).