From: Josef Bacik <josef@toxicpanda.com>
To: kernel-team@fb.com, linux-btrfs@vger.kernel.org
Subject: [PATCH 0/2][v2] Rework the worst case calculations for space reservation
Date: Thu, 22 Aug 2019 15:14:32 -0400 [thread overview]
Message-ID: <20190822191434.13800-1-josef@toxicpanda.com> (raw)
v1->v2:
- dropped "btrfs: global reserve fallback should use metadata_size", turns out
I was testing without my evict changes in place so we don't even need this in
the first place, but it is also wrong because we need to reserve space for the
orphan item which is an insert.
- Added the reviewed-by's.
-- Original email --
We have two worst case calculations for space reservation, one that takes into
account splitting at every level when cow'ing down the btree, and another that
doesn't account for splitting at all. The first is used everywhere, and the
second is used mostly for truncate.
However we also do not split when we're only changing an item, so for example
updating the inode item. So the name for this helper is wrong, because it can
be used for in-place updates as well as for truncates. Rename the helpers and
then use the smaller worst-case reservation for inode updates in a few places.
As a rule we still want to use the insert calculation when we can't be sure what
kind of operation is going to end up happening. But for things like delayed
inode updates and file writes where we know there is going to be an existing
inode item we can use the smaller reservation. Thanks,
Josef
next reply other threads:[~2019-08-22 19:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-22 19:14 Josef Bacik [this message]
2019-08-22 19:14 ` [PATCH 1/2] btrfs: rename the btrfs_calc_*_metadata_size helpers Josef Bacik
2019-08-22 19:14 ` [PATCH 2/2] btrfs: only reserve metadata_size for inodes Josef Bacik
2019-08-23 13:03 ` [PATCH 0/2][v2] Rework the worst case calculations for space reservation 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=20190822191434.13800-1-josef@toxicpanda.com \
--to=josef@toxicpanda.com \
--cc=kernel-team@fb.com \
--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