linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <jbacik@fb.com>
To: cwillu <cwillu@cwillu.com>, Hugo Mills <hugo@carfax.org.uk>,
	"lin >> linux-btrfs@vger.kernel.org"
	<linux-btrfs@vger.kernel.org>
Subject: Re: What to do about df and btrfs fi df
Date: Mon, 10 Feb 2014 13:28:26 -0500	[thread overview]
Message-ID: <52F91A4A.4080807@fb.com> (raw)
In-Reply-To: <CAE5mzvgFLfQoaNx1eWB2z_kJW-pe1bFY_3LxDMV9XbtKApo=xw@mail.gmail.com>



On 02/10/2014 01:24 PM, cwillu wrote:
> I concur.
>
> The regular df data used number should be the amount of space required
> to hold a backup of that content (assuming that the backup maintains
> reflinks and compression and so forth).
>
> There's no good answer for available space; the statfs syscall isn't
> rich enough to cover all the bases even in the face of dup metadata
> and single data (i.e., the common case), and a truly conservative
> estimate (report based on the highest-usage raid level in use) would
> report space/2 on that same common case.  "Highest-usage data raid
> level in use" is probably the best compromise, with a big warning that
> that many large numbers of small files will not actually fit, posted
> in some mythical place that users look.
>
> I would like to see the information from btrfs fi df and btrfs fi show
> summarized somewhere (ideally as a new btrfs fi df output), as both
> sets of numbers are really necessary, or at least have btrfs fi df
> include the amount of space not allocated to a block group.
>
> Re regular df: are we adding space allocated to a block group (raid1,
> say) but not in actual use in a file as the N/2 space available in the
> block group, or the N space it takes up on disk?  This probably
> matters a bit less than it used to, but if it's N/2, that leaves us
> open to "empty filesystem, 100GB free, write a 80GB file and then
> delete it, wtf, only 60GB free now?" reporting issues.
>

The only case we add the actual allocated chunk space is for metadata, 
for data we only add the actual used number.  So say say you write 80gb 
file and then delete it but during the writing we allocated a 1 gig 
chunk for metadata you'll see only 99gb free, make sense?  We could 
(should?) roll this into the b_avail magic and make "used" really only 
reflect data usage, opinions on this?  Thanks,

Josef

  reply	other threads:[~2014-02-10 18:28 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-10 16:41 What to do about df and btrfs fi df Josef Bacik
2014-02-10 17:06 ` Hugo Mills
2014-02-10 18:24   ` cwillu
2014-02-10 18:28     ` Josef Bacik [this message]
2014-02-10 18:36       ` cwillu
2014-02-10 18:41         ` Josef Bacik
2014-02-10 18:54           ` cwillu
2014-02-10 19:05           ` Hugo Mills
2014-02-11 17:36           ` David Sterba
2014-02-17 17:08           ` David Sterba
2014-02-18  8:33             ` Goswin von Brederlow
2014-02-18 16:43               ` David Sterba
2014-02-11  1:02     ` Roger Binns
2014-02-11  3:13       ` cwillu
2014-02-11  3:35         ` ronnie sahlberg
2014-02-11 19:58         ` Roger Binns
2014-02-10 22:14   ` Goffredo Baroncelli
2014-02-10 22:26 ` Goffredo Baroncelli
2014-02-10 22:56   ` cwillu
2014-02-11 13:14   ` Josef Bacik
2014-02-11 18:20     ` Goffredo Baroncelli
2014-02-11 18:33       ` Josef Bacik
2014-02-11 18:46         ` Goffredo Baroncelli
2014-02-11 18:56       ` Hugo Mills
2014-02-12 21:03         ` Goffredo Baroncelli
2014-02-11 20:53 ` Sandy McArthur
2014-02-12  3:09   ` Kostia Khlebopros
2014-02-12 21:12     ` Goffredo Baroncelli
2014-02-12  3:55 ` Anand Jain

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=52F91A4A.4080807@fb.com \
    --to=jbacik@fb.com \
    --cc=cwillu@cwillu.com \
    --cc=hugo@carfax.org.uk \
    --cc=linux-btrfs@vger.kernel.org \
    /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).