linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Nikolay Borisov <nborisov@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: Remove unnecessary check from join_running_log_trans
Date: Thu, 1 Aug 2019 15:03:43 +0200	[thread overview]
Message-ID: <20190801130343.GS28208@twin.jikos.cz> (raw)
In-Reply-To: <20190523115126.10532-1-nborisov@suse.com>

On Thu, May 23, 2019 at 02:51:26PM +0300, Nikolay Borisov wrote:
> join_running_log_trans checks btrfs_root::log_root outside of
> btrfs_root::log_mutex to avoid contention on the mutex. Turns out this
> check is not necessary because the two callers of join_running_log_trans
> (both of which deal with removing entries from the tree-log during
> unlink) explicitly check whether the respective inode has been logged in
> the current transaction. If it hasn't then it won't have any items in
> the tree-log and call path will return before calling
> join_running_log_trans. If the check passes, however, then it's
> guaranteed that btrfs_root::log_root is set because the inode is logged.
> 
> Those guarantees allows us to remove the speculative as well as the
> implicity and tricky memory barrier. No functionl changes.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---

Added to misc-next, thanks.

      parent reply	other threads:[~2019-08-01 13:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23 11:51 [PATCH] btrfs: Remove unnecessary check from join_running_log_trans Nikolay Borisov
2019-07-12 11:24 ` Filipe Manana
2019-08-01 13:03 ` David Sterba [this message]

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=20190801130343.GS28208@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /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).