From: Josef Bacik <josef@toxicpanda.com>
To: fdmanana@kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: remove unnecessary attempt do drop extent maps after adding inline extent
Date: Fri, 13 Nov 2020 13:09:40 -0500 [thread overview]
Message-ID: <8598e119-533c-b1fa-9574-1567a3353430@toxicpanda.com> (raw)
In-Reply-To: <1b80a3ffc965dbf663ab746dc11ea5e9fa1e10bf.1605266387.git.fdmanana@suse.com>
On 11/13/20 6:24 AM, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> At inode.c:cow_file_range_inline(), after we insert the inline extent
> in the fs/subvolume btree, we call btrfs_drop_extent_cache() to drop
> all extent maps in the file range, however that is not necessary because
> we have already done it in the call to btrfs_drop_extents(), which calls
> btrfs_drop_extent_cache() for us, and since at this point we have the file
> range locked in the inode's iotree (we are in the writeback path), we know
> no other task can come in and read stale file extent items or find none
> and therefore create either stale extent maps or an extent map that
> represens a hole.
>
> So just remove that unnecessary call to btrfs_drop_extent_cache(), as it's
> doing nothing and only wasting time. This call has been around since 2008,
> introduced in commit c8b978188c9a ("Btrfs: Add zlib compression support"),
> but even back then it seems it was not necessary, since we had the range
> locked in the inode's iotree and the call to btrfs_drop_extents() already
> used to always call btrfs_drop_extent_cache().
>
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Thanks,
Josef
next prev parent reply other threads:[~2020-11-13 18:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-13 11:24 [PATCH] btrfs: remove unnecessary attempt do drop extent maps after adding inline extent fdmanana
2020-11-13 18:09 ` Josef Bacik [this message]
2020-11-16 15:29 ` David Sterba
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=8598e119-533c-b1fa-9574-1567a3353430@toxicpanda.com \
--to=josef@toxicpanda.com \
--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