From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
To: Josef Bacik <jbacik@fb.com>
Cc: Daniele Testa <daniele.testa@gmail.com>, linux-btrfs@vger.kernel.org
Subject: Re: btrfs is using 25% more disk than it should
Date: Tue, 23 Dec 2014 16:51:43 -0500 [thread overview]
Message-ID: <20141223215119.GD436@hungrycats.org> (raw)
In-Reply-To: <54955D56.20900@fb.com>
[-- Attachment #1: Type: text/plain, Size: 1813 bytes --]
On Sat, Dec 20, 2014 at 06:28:22AM -0500, Josef Bacik wrote:
> We now have two extents
> with the same bytenr but with different lengths.
>[...]
> Then there is the problem of actually returning the free space. Now
> if we drop all of the refs for an extent we know the space is free
> and we return it to the allocator. With the above example we can't
> do that anymore, we have to check the extent tree for any area that
> is left overlapping the area we just freed. This add's another
> search to every btrfs_free_extent operation, which slows the whole
> system down and again leaves us with weird corner cases and pain for
> the users. Plus this would be an incompatible format change so
> would require setting a feature flag in the fs and rolled to
> voluntarily.
Ouchie.
> Now I have another solution, but I'm not convinced it's awesome
> either. Take the same example above, but instead we split the
> original extent in the extent tree so we avoid all the mess of
> having overlapping ranges
Would this work for a read-only snapshot? For a read-write snapshot
it would be as if we had modified both (or all, if there are multiple
snapshots) versions of the tree with split extents.
> This wouldn't require a format change so everybody would get
> this behaviour as soon as we turned it on
It could be a mount option, like autodefrag, off by default until the
bugs were worked out.
Arguably there could be a 'garbage-collection tool' similar to 'btrfs
fi defrag', that could be used to clean out any large partially-obscured
extents from specific files. This might be important for deduplication
as well (although the extent-same code looks like it does split extents?).
Definitely something to think about. Thanks for the detailed
explanations.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2014-12-23 21:51 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-18 14:59 btrfs is using 25% more disk than it should Daniele Testa
2014-12-19 18:53 ` Phillip Susi
2014-12-19 19:59 ` Daniele Testa
2014-12-19 20:35 ` Phillip Susi
2014-12-19 21:15 ` Josef Bacik
2014-12-19 21:53 ` Phillip Susi
2014-12-19 22:06 ` Josef Bacik
2014-12-20 1:33 ` Duncan
2014-12-19 21:10 ` Josef Bacik
2014-12-19 21:17 ` Josef Bacik
2014-12-20 1:38 ` Duncan
2014-12-20 5:52 ` Zygo Blaxell
2014-12-20 6:18 ` Daniele Testa
2014-12-20 6:59 ` Duncan
2014-12-20 11:02 ` Josef Bacik
2014-12-20 11:28 ` Josef Bacik
2014-12-23 21:51 ` Zygo Blaxell [this message]
2014-12-20 9:15 ` Daniele Testa
2014-12-20 11:23 ` Robert White
2014-12-20 11:39 ` Josef Bacik
2014-12-21 1:40 ` Robert White
2014-12-21 3:04 ` Robert White
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=20141223215119.GD436@hungrycats.org \
--to=ce3g8jdj@umail.furryterror.org \
--cc=daniele.testa@gmail.com \
--cc=jbacik@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;
as well as URLs for NNTP newsgroup(s).