From: David Sterba <dsterba@suse.cz>
To: Remi Gauvin <remi@georgianit.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: Does btrfs filesystem defragment -r also include the trees?
Date: Fri, 21 Apr 2023 00:42:42 +0200 [thread overview]
Message-ID: <20230420224242.GZ19619@twin.jikos.cz> (raw)
In-Reply-To: <b7c067eb-e828-35f7-4b26-499173fd07d9@georgianit.com>
On Thu, Apr 20, 2023 at 08:37:07AM -0400, Remi Gauvin wrote:
> I have recently experienced that btrfs defragment (by itself, without
> -r) of a subvolume can dramatically improve performance when accessing
> very large directories. I would go so far as to call it critical
> maintenance when working with gtk3 based file managers.
>
> What I am not clear on, however, does adding the -r *also* defragment
> the subvolume extent tree, or do the two commands needs to be run
> separately to get the full effect?
No, -r does not defragment the extent tree, so if you really want to
defragment the extent tree, then you need to run it separately and
without -r.
Originally there was only the extent tree defragmentation which was
confusing when defrag got a directory as an argument, then it always
defragmented the extent tree but did not descend recursively. Then the
-r was added and the bare directory path discouraged. It still works
though.
I've checked if this is documented, it seems to (btrfs-filesystem,
section defrag):
"NOTE: Directory arguments without -r do not defragment files
recursively but will defragment certain internal trees (extent tree and
the subvolume tree). This has been confusing and could be re- moved in
the future."
but if you think it's not clear enough please suggest in what way it
could be extended or what's missing.
next prev parent reply other threads:[~2023-04-20 22:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-20 12:37 Does btrfs filesystem defragment -r also include the trees? Remi Gauvin
2023-04-20 22:42 ` David Sterba [this message]
2023-04-21 7:57 ` Qu Wenruo
2023-04-21 12:21 ` Remi Gauvin
2023-04-21 17:41 ` waxhead
2023-04-21 21:00 ` Forza
2023-04-21 21:27 ` Remi Gauvin
2023-04-21 21:40 ` joshua
2023-04-21 22:55 ` Qu Wenruo
2023-04-21 23:25 ` joshua
2023-04-22 0:42 ` Qu Wenruo
2023-04-23 9:34 ` waxhead
2023-04-23 10:50 ` Qu Wenruo
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=20230420224242.GZ19619@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=remi@georgianit.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.