public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Jorge Bastos <jorge.mrbastos@gmail.com>
Cc: Chris Murphy <lists@colorremedies.com>,
	Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: df free space not correct with raid1 pools with an odd number of devices
Date: Sat, 25 Jul 2020 13:21:54 +0300	[thread overview]
Message-ID: <dc1197d9-0265-78a3-b7f7-06ad72a24c3e@gmail.com> (raw)
In-Reply-To: <CAHzMYBTUx5Xp9HVhB5r-eQRrL=8fdQwKY=awfGTCxqczCHSsHA@mail.gmail.com>

25.07.2020 13:04, Jorge Bastos пишет:
> On Sat, Jul 25, 2020 at 8:43 AM Andrei Borzenkov <arvidjaar@gmail.com> wrote:
>>
> 
>>
>> OTOH, this is the correct if the most pessimistic estimation either. If
>> you have three 250G RAID1 devices and you allocate 250G data in one file
>> you consume two full devices and won't be able to allocate new data at
>> all (or for that matter no new metadata either).
>>
>>
>> So whatever value btrfs returns will be wrong for some allocation pattern.
> 
> I considered that but wouldn't a single file still be stripped and
> blocks allocated to all devices, on a most free space basis?
> 

Yes, I was unsure and stay corrected. It seems real allocation happens
per chunk and so gets distributed to all devices.

Sorry.

> E.g.: 3 x 500GB RAID1 pool:
> 
> $ btrfs fi usage -T /mnt/cache
> Overall:
>     Device size:                   1.36TiB
>     Device allocated:              2.13GiB
>     Device unallocated:            1.36TiB
>     Device missing:                  0.00B
>     Used:                        288.00KiB
>     Free (estimated):            697.61GiB      (min: 697.61GiB)
>     Data ratio:                       2.00
>     Metadata ratio:                   2.00
>     Global reserve:                3.25MiB      (used: 32.00KiB)
>     Multiple profiles:                  no
> 
>              Data     Metadata  System
> Id Path      RAID1    RAID1     RAID1    Unallocated
> -- --------- -------- --------- -------- -----------
>  1 /dev/sdb1 36.00MiB         - 32.00MiB   465.69GiB
>  2 /dev/sde1 36.00MiB   1.00GiB 32.00MiB   464.69GiB
>  3 /dev/sdf1        -   1.00GiB        -   464.76GiB
> -- --------- -------- --------- -------- -----------
>    Total     36.00MiB   1.00GiB 32.00MiB     1.36TiB
>    Used         0.00B 128.00KiB 16.00KiB
> 
> 
> 
> $ fallocate -l 690G /mnt/cache/file
> $ btrfs fi usage -T /mnt/cache
> Overall:
>     Device size:                   1.36TiB
>     Device allocated:              1.35TiB
>     Device unallocated:           13.15GiB
>     Device missing:                  0.00B
>     Used:                          1.35TiB
>     Free (estimated):              7.61GiB      (min: 7.61GiB)
>     Data ratio:                       2.00
>     Metadata ratio:                   2.00
>     Global reserve:                3.25MiB      (used: 0.00B)
>     Multiple profiles:                  no
> 
>              Data      Metadata  System
> Id Path      RAID1     RAID1     RAID1     Unallocated
> -- --------- --------- --------- --------- -----------
>  1 /dev/sdb1 461.04GiB         -  32.00MiB     4.69GiB
>  2 /dev/sde1 460.04GiB   1.00GiB  32.00MiB     4.69GiB
>  3 /dev/sdf1 461.00GiB   1.00GiB         -     3.76GiB
> -- --------- --------- --------- --------- -----------
>    Total     691.04GiB   1.00GiB  32.00MiB    13.15GiB
>    Used      690.00GiB 976.00KiB 112.00KiB
> 
> Jorge
> 


      reply	other threads:[~2020-07-25 10:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23 10:24 df free space not correct with raid1 pools with an odd number of devices Jorge Bastos
2020-07-24  4:40 ` Chris Murphy
2020-07-24  6:53   ` Rolf Wald
2020-07-24  8:16   ` Jorge Bastos
2020-07-24 20:46     ` Chris Murphy
2020-07-25  2:19       ` Chris Murphy
2020-07-25  7:30       ` Andrei Borzenkov
2020-07-25  7:43         ` Andrei Borzenkov
2020-07-25 10:04           ` Jorge Bastos
2020-07-25 10:21             ` Andrei Borzenkov [this message]

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=dc1197d9-0265-78a3-b7f7-06ad72a24c3e@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=jorge.mrbastos@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lists@colorremedies.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