On Thu, Aug 08, 2013 at 06:48:05AM -0700, Christoph Hellwig wrote:
> On Thu, Aug 08, 2013 at 09:02:07AM -0400, Josef Bacik wrote:
> > This won't work, try having 10000 subvolumes with dirty inodes and do sync 
> > then
> > go skiing, you'll have time :).  Thanks,
> 
> Why would the dirty inodes make any difference?  If you share the bdi
> between the subvolumes the sync workflow should be exactly the same
> still.
> 

The inodes are in the per-sb list, so we may start all the writing but we don't
wait all at once, so in the case of btrfs we will write all the dirty inodes,
and then wait on the ones in whatever sb we have, and then sync, which will
commit the transaction.  Then we go to the next sb and wait on those inodes
which will dirty metadata which means we'll have another transaction and we'll
commit the transaction and so on and so forth.  This means we write the
superblock 10000 times for one sync when we could have just done it once.

Now we could probably get around this by having ->sync_fs wait itself for all of
the inodes to complete and then commit the transaction once, but we're still
going to get called the 99999 times for the same damned file system that has
already had everything done.

And this is just one example, IIRC there were a few other issues that popped up
because we assume sb == completely separate file system, freeze I think is one
of those things.  I'm sure there were other ones but the last time I tried to do
this was 2010/2011 and many brain cells have died since then.  Thanks,

Josef
--
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

Reply via email to