Re: [RFC][PATCH 1/2] fs: use RCU for free_super() vs. __sb_start_write()

From: Dave Hansen
Date: Wed Jun 24 2015 - 16:21:37 EST


On 06/23/2015 04:09 AM, Jan Kara wrote:
>> @@ -1340,7 +1344,7 @@ int freeze_super(struct super_block *sb)
>> printk(KERN_ERR
>> "VFS:Filesystem freeze failed\n");
>> sb->s_writers.frozen = SB_UNFROZEN;
>> - smp_wmb();
>> + synchronize_rcu();
>
> Do we really need synchronize_rcu() here? We just need to make sure write
> to sb->s_writers.frozen happens before we start waking processes...

I don't think it is necessary. We only need to be concerned in practice
if someone could be inside a critical section when we are executing
this. I *think* the only case that we have that really matters will be
taken care of by the _first_ synchronize_rcu().

It's definitely worth adding a comment.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/