From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
To: Phil Karn <karn@ka9q.net>
Cc: Paul Jones <paul@pauljones.id.au>,
Jean-Denis Girard <jd.girard@sysnux.pf>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: Extremely slow device removals
Date: Sat, 2 May 2020 03:52:33 -0400 [thread overview]
Message-ID: <20200502075233.GN10769@hungrycats.org> (raw)
In-Reply-To: <CAMwB8miVfp_vpJaak=W_PK-xYtb=Py1zqqVYXWo_3NN4a9Dk7Q@mail.gmail.com>
On Sat, May 02, 2020 at 12:27:27AM -0700, Phil Karn wrote:
> > deleted the originals in logical extent order. Sometimes people call this
> > "defrag free space" but the use of the word "defrag" can be confusing.
> >
> > balance is not btrfs defrag. defrag is concerned with making data extents
> > contiguous, while balance is concerned with making free space contiguous.
>
> Got it. I actually would have understood "defrag free space" and that
> it differed from file defragmentation (btrfs defrag, xfs_fsr,
> e4defrag, etc). "Balance" confused me.
>
> How do you balance free space when you've got drives of unequal sizes,
> like my (current) case of a 4-drive array consisting of two 16-TB
> drives and two 6-TB drives?
Depends on the RAID profile. For single, dup, raid1, raid1c3, and raid1c4,
the drives with the most unallocated space are filled first, using devid
to break ties. For raid0, raid5, and raid6, drives with free space are
filled equally. raid10 fills disks in even-numbered groups of 4 or more
drives at a time, filling disks with the most unallocated space first.
There are some other rules (e.g. at most 10 disks are used in a single
block group) but they're not relevant at this scale.
raid1 and single profiles would fill the 16TB drives first, until there
was only 6 TB remaining. At this point all the drives would have equal
free space, then all drives fill equally until they are all full.
raid0 and raid5 would fill all the disks at first, until the 6TB drives are
full and the 16TB drives have 10TB of free space, then they'd fill the
16TB drives the rest of the way.
raid1c3, raid1c4, raid6 and raid10 would fill all the drives at first,
then stop with ENOSPC when the 6TB disks are full and the 16TB disks
have 10TB of free space. These profiles have a minimum of 3 or more
disks, and you don't have that number of the largest size disks.
Once all the smaller disks are full no further allocation can be done.
> Phil
next prev parent reply other threads:[~2020-05-02 7:52 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-28 7:22 Extremely slow device removals Phil Karn
2020-04-30 17:31 ` Phil Karn
2020-04-30 18:13 ` Jean-Denis Girard
2020-05-01 8:05 ` Phil Karn
2020-05-02 3:35 ` Zygo Blaxell
[not found] ` <CAMwB8mjUw+KV8mxg8ynPsv0sj5vSpwG7_khw=oP5n+SnPYzumQ@mail.gmail.com>
2020-05-02 4:31 ` Zygo Blaxell
2020-05-02 4:48 ` Paul Jones
2020-05-02 5:25 ` Phil Karn
2020-05-02 6:04 ` Remi Gauvin
2020-05-02 7:20 ` Zygo Blaxell
2020-05-02 7:27 ` Phil Karn
2020-05-02 7:52 ` Zygo Blaxell [this message]
2020-05-02 6:00 ` Zygo Blaxell
2020-05-02 6:23 ` Paul Jones
2020-05-02 7:20 ` Phil Karn
2020-05-02 7:42 ` Zygo Blaxell
2020-05-02 8:22 ` Phil Karn
2020-05-02 8:24 ` Phil Karn
2020-05-02 9:09 ` Zygo Blaxell
2020-05-02 17:48 ` Chris Murphy
2020-05-03 5:26 ` Zygo Blaxell
2020-05-03 5:39 ` Chris Murphy
2020-05-03 6:05 ` Chris Murphy
2020-05-04 2:09 ` Phil Karn
2020-05-02 7:43 ` Jukka Larja
2020-05-02 4:49 ` Phil Karn
2020-04-30 18:40 ` Chris Murphy
2020-04-30 19:59 ` Phil Karn
2020-04-30 20:27 ` Alexandru Dordea
2020-04-30 20:58 ` Phil Karn
2020-05-01 2:47 ` Zygo Blaxell
2020-05-01 4:48 ` Phil Karn
2020-05-01 6:05 ` Alexandru Dordea
2020-05-01 7:29 ` Phil Karn
2020-05-02 4:18 ` Zygo Blaxell
2020-05-02 4:48 ` Phil Karn
2020-05-02 5:00 ` Phil Karn
2020-05-03 2:28 ` Phil Karn
2020-05-04 7:39 ` Phil Karn
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=20200502075233.GN10769@hungrycats.org \
--to=ce3g8jdj@umail.furryterror.org \
--cc=jd.girard@sysnux.pf \
--cc=karn@ka9q.net \
--cc=linux-btrfs@vger.kernel.org \
--cc=paul@pauljones.id.au \
/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).