linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liu Bo <bo.li.liu@oracle.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/2] Btrfs: remove bio_flags which indicates a meta block of log-tree
Date: Wed, 13 Sep 2017 11:11:03 -0600	[thread overview]
Message-ID: <20170913171103.GC22943@dhcp-10-211-47-181.usdhcp.oraclecorp.com> (raw)
In-Reply-To: <20170913164330.GQ29043@twin.jikos.cz>

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

  reply	other threads:[~2017-09-13 18:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 21:49 [PATCH 1/2 RESEND] Btrfs: make plug in writing meta blocks really work Liu Bo
2017-08-21 21:50 ` [PATCH 2/2] Btrfs: remove bio_flags which indicates a meta block of log-tree Liu Bo
2017-09-13 16:43   ` David Sterba
2017-09-13 17:11     ` Liu Bo [this message]
2017-09-13 18:18   ` [PATCH 2/2 v2] " Liu Bo
2017-09-14 17:02     ` David Sterba
2017-09-13 15:51 ` [PATCH 1/2 RESEND] Btrfs: make plug in writing meta blocks really work David Sterba
2017-09-13 16:45   ` Liu Bo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170913171103.GC22943@dhcp-10-211-47-181.usdhcp.oraclecorp.com \
    --to=bo.li.liu@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).