From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: Kernel 3.19 and still "disk full" even though 'btrfs fi df" reports enough room left?
Date: Fri, 20 Nov 2015 03:14:38 +0000 (UTC) [thread overview]
Message-ID: <pan$7f2a7$22f8253d$ae640ac3$36e4e58d@cox.net> (raw)
In-Reply-To: 20151119185645.GF24333@carfax.org.uk
linux-btrfs.tebulin posted on Thu, 19 Nov 2015 18:56:45 +0000 as
excerpted:
Meta-comment:
Apparently that attribution should actually be to Hugo Mills. I've no
idea what went wrong, but at least here as received from gmane.org, the
from header really does say linux-btrfs.tebulin, so something obviously
bugged out somewhere!
Meanwhile discussing btrfs data/metadata allocation, vs. usage of that
allocation, Hugo also known here as tebulin, explained...
> If you've ever played SimCity, the allocation process is like zoning --
> you say what kind of thing can go on the space, but it's not actually
> used until something gets built on it.
Very nice analogy. Thanks. =:^)
Tho I'd actually put it in terms of the real thing that sim city
simulates, thus eliminating the proprietary comparison. A city zones an
area one way or another, restricting what can be built there -- you can't
put heavy industry in a residential zone. But the lot is still empty
until something's actually built there.
And if the city has all its area zoned residential, and some company
wants to build a plant there (generally considered a good thing as it'll
provide employment), there's a process that allows rezoning.
In btrfs, there's four types of allocations aka "zones":
1) Unallocated (unzoned)
Can be used for anything but must be allocated/zoned first
2) System
Critical but limited in size and generally only allocated at mkfs or when
adding a new device.
3) Data
The actual file storage, generally the largest allocation.
4) Metadata
Information /about/ the files, where they are located (the location and
size of individual extents), ownership and permissions, date stamps,
checksums, and for very small files (a few KiB), sometimes the file
content itself.
4a) Global reserve
A small part of metadata reserved for emergency use only. Btrfs is
pretty strict about its use, and will generally error out with ENOSPC if
metadata space other than the global reserve is used up, before actually
using this global reserve. As a result, any of the global reserve used
at all indicates a filesystem in very severe straits, crisis mode.
As it happens, btrfs in practice tends to be a bit liberal about
allocating/zoning data chunks, since it's easier to find bigger blocks of
space in unallocated space than it is in busy partly used data space.
(Think of a big shopping center. It's easier to build it in outlying
areas that haven't been built up yet, where many whole blocks worth of
space can be allocated/zoned at once, than it is in the city center,
where even finding a single whole block vacant, is near impossible.)
Over time, therefore, more and more space tends to be allocated to data,
while existing data space, like those blocks near city center, may have
most of its files/buildings deleted, but still have a couple still
occupied.
Btrfs balancing, then, is comparable to the city functions of
condemnation and rezoning to vacant/unallocated, forcing remaining
occupants, most commonly data zoned, to move out of the way so the area
can be reclaimed for other usage. Then it can be rezoned to data again,
or to metadata, whatever needs it.
(FWIW, I played the original sim city, but IIRC it wasn't sophisticated
enough to have zoning yet. Of course I've not played anything recent as
to my knowledge it's not freedomware, and since I no longer agree to
waive rights via EULA, etc, I can no longer legally install and run such
things. But the real life sim city simulates, is the antitype behind
both that simulation, and the analogy I drew here, based on the one you
drew to the simulation.)
--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
next prev parent reply other threads:[~2015-11-20 3:14 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-18 18:53 Kernel 3.19 and still "disk full" even though 'btrfs fi df" reports enough room left? linux-btrfs.tebulin
2015-11-18 19:08 ` Hugo Mills
2015-11-19 0:42 ` Qu Wenruo
2015-11-19 2:16 ` Duncan
2015-11-20 11:39 ` Dmitry Katsubo
2015-11-20 13:21 ` Austin S Hemmelgarn
2015-11-20 13:27 ` Hugo Mills
2015-11-20 13:52 ` Austin S Hemmelgarn
2015-11-20 16:39 ` Dmitry Katsubo
2015-11-19 17:35 ` linux-btrfs.tebulin
2015-11-19 18:28 ` Hugo Mills
2015-11-19 18:45 ` linux-btrfs.tebulin
2015-11-19 18:56 ` linux-btrfs.tebulin
2015-11-19 19:26 ` linux-btrfs.tebulin
2015-11-20 3:14 ` Duncan [this message]
2015-11-20 9:38 ` linux-btrfs.tebulin
2015-11-20 10:44 ` Duncan
2015-11-20 14:25 ` Dmitry Katsubo
2015-11-19 20:18 ` Austin S Hemmelgarn
2015-11-19 5:58 ` Roman Mamedov
2015-11-19 8:31 ` Patrik Lundquist
2015-11-19 12:28 ` Austin S Hemmelgarn
2015-11-20 2:11 ` Duncan
2015-11-20 13:13 ` Austin S Hemmelgarn
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='pan$7f2a7$22f8253d$ae640ac3$36e4e58d@cox.net' \
--to=1i5t5.duncan@cox.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.