public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: fdmanana@kernel.org
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: avoid unnecessary ref initialization when freeing log tree block
Date: Mon, 19 Feb 2024 15:46:04 +0100	[thread overview]
Message-ID: <20240219144604.GW355@twin.jikos.cz> (raw)
In-Reply-To: <06acd07b61968eaecded7c22d07cd72030fbef6b.1708347488.git.fdmanana@suse.com>

On Mon, Feb 19, 2024 at 01:00:22PM +0000, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> At btrfs_free_tree_block(), we are always initializing a delayed reference
> to drop the given extent buffer but we only use if it does not belong to a
> log root tree. So we are doing unnecessary work here and increasing the
> duration of a critical section as this is normally called while holding a
> lock on the parent tree block (if any) and while holding a log transaction
> open.
> 
> So initialize the delayed reference only if the extent buffer is not from
> a log tree, avoiding unnecessary work and making the code also a bit
> easier to follow.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Reviewed-by: David Sterba <dsterba@suse.com>

  reply	other threads:[~2024-02-19 14:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19 13:00 [PATCH] btrfs: avoid unnecessary ref initialization when freeing log tree block fdmanana
2024-02-19 14:46 ` David Sterba [this message]
2024-02-20  0:12 ` Naohiro Aota

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=20240219144604.GW355@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=fdmanana@kernel.org \
    --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