linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Paul Richards <paul.richards@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Does balance implicitly defrag?
Date: Mon, 8 Jul 2013 23:12:08 +0200	[thread overview]
Message-ID: <20130708211208.GF18204@twin.jikos.cz> (raw)
In-Reply-To: <CAMoswei+L-kH_O9uRecOorpS6Kf5hnZ9j3nxZ36kzFR6G9uXeg@mail.gmail.com>

On Tue, Jul 02, 2013 at 02:28:25PM +0100, Paul Richards wrote:
> When I run "btrfs filesystem balance", does this implicitly
> defragment the filesystem?  (Assuming there is plenty free space)

In some sense it defragments the filesystem. The blockgroups are moved
around based on the balance filter. Here a blockgroup consists of
various and unrelated file extents. Extents representing a single file
are not made contiguous, this is done by 'btrfs file defrag'.

I think that the final layout of the 1G-chunks is not necessarily
contiguous, ie. it depends on the chunk-allocator, the time of the
allocation request and there's nothing like "preallocate 30G for whole
balance and put all data together because the space is available".

david

  reply	other threads:[~2013-07-08 21:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-02 13:28 Does balance implicitly defrag? Paul Richards
2013-07-08 21:12 ` David Sterba [this message]
2013-07-08 21:30   ` Paul Richards

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=20130708211208.GF18204@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=paul.richards@gmail.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 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).