Re: Extremely slow device removals

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux