On Wed, Sep 13, 2017 at 06:43:30PM +0200, David Sterba wrote: > On Mon, Aug 21, 2017 at 03:50:00PM -0600, Liu Bo wrote: > > Since both committing transaction and writing log-tree are doing > > plugging on metadata IO, we can unify to use %sync_writers to benefit > > both cases, instead of checking bio_flags while writing meta blocks of > > log-tree. > > > > This removes the bio_flags related stuff for writing log-tree. > > I'm not sure if this preserves the intentions introduced in > de0022b9da616b95ea5, as it's meant to do the checksums synchronously > (without offloading to other threads), if it's for the tree-log. So now > it depends on the sync_writers count to do that, while with the bio flag > it was independent. > > The sync_writers is per-inode, while the bio flag is from the > submit_bio hook, so it's per-context. Again, blame me for not making the commit log clear enough. We can remove this bio_flags because in order to write dirty blocks, log tree also uses btrfs_write_marked_extents(), inside which PATCH 1 has enabled %sync_writers, therefore, every write goes in a synchronous way, so does checksuming. WRT per-inode vs per-context, yes, they're a bit different, but the only overhead I could think of is that 1) while log tree is flushing its dirty blocks via btrfs_write_marked_extents(), in which %sync_writers is increased by one. 2) in the meantime, some writeback operations may happen upon btrfs's metadata inode, so these writes go synchronously, too. However, AFAICS, the overhead is not a big one while the win is that we unify the two places that needs synchronous way and remove a special hack/flag. Thanks, -liubo -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
