On Wed, Sep 13, 2017 at 12:18:22PM -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. > > We can remove this bio_flags because in order to write dirty blocks, > log tree also uses btrfs_write_marked_extents(), inside which we > has enabled %sync_writers, therefore, every write goes in a > synchronous way, so does checksuming. > > Please also note that, bio_flags is applied per-context while > %sync_writers is applied per-inode, so this might incur some overhead, ie. > > 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. > > This removes the bio_flags related stuff for writing log-tree. > > Signed-off-by: Liu Bo <bo.li.liu@xxxxxxxxxx> Much better, thanks. Reviewed-by: David Sterba <dsterba@xxxxxxxx> -- 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
