From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: [btrfs-progs] Bug in mkfs.btrfs -r
Date: Sat, 2 Sep 2017 04:03:06 +0000 (UTC) [thread overview]
Message-ID: <pan$9833c$c04b7334$d8bed9c4$4b7b46fb@cox.net> (raw)
In-Reply-To: fb4721b1-1c79-73fb-405a-cfc8fa4d710c@gmail.com
Austin S. Hemmelgarn posted on Fri, 01 Sep 2017 10:07:47 -0400 as
excerpted:
> On 2017-09-01 09:54, Qu Wenruo wrote:
>>
>> On 2017年09月01日 20:47, Austin S. Hemmelgarn wrote:
>>> On 2017-09-01 08:19, Qu Wenruo wrote:
>>>>
>>>> Current kernel (and btrfs-progs also tries to follow kernel chunk
>>>> allocator's behavior) will not make a chunk larger than 10% of RW
>>>> space.
>>>> So for small filesystem chunk won't be too maximally sized.
>>> Are you sure about this? I've got a couple of sub 10GB BTRFS volumes
>>> that definitely have more than one 1GB data chunk.
>>
>> Yes, check the following code:
>>
>> /* we don't want a chunk larger than 10% of writeable space */
>> max_chunk_size = min(div_factor(fs_devices->total_rw_bytes, 1),
>> max_chunk_size);
>>
>> Which is in __btrfs_alloc_chunk() function in fs/btrfs/volumes.c
> Huh, I may have the remnants of an old bug present on those filesystems
> then, I'll have to look further into this.
Please do.
While I redid my /boot (and backups on other devices) when I upgraded to
all-ssd, and my /boot is now 512 MiB, with what appears to be a 64 MiB
first-chunk (mixed-bg mode so data/metadata), doubled due to dup-mode to
128 MiB, and while that works out to 1/8=12.5% of the filesystem size,
it still rebalances just fine as long as there's still 128 MiB unallocated
to create the new chunks to write into.
But my earlier layout had a 256 MiB /boot (and backups), and the initial
chunk size was *STILL* 64 MiB, dup to 128 MiB, half the 256 MiB filesystem
size so obviously no balance of that chunk possible because there's not
enough space left after the system chunk takes its byte as well, to write
the new copy of the chunk (and its dup) into.
Now the last time I redid the old layout /boot with a mkfs.btrfs was
several kernel and userspace cycles ago now, so mkfs.btrfs might well have
changed and now creates smaller chunks on a 256 MiB filesystem, but it
sure was frustrating not to be able to rebalance that chunk, and I don't
/know/ that the bug was fixed, because I have the larger /boot now. Tho
as I said even there it's apparently 1/8, 12.5%, larger than the 10%
quoted, yet I know 32 MiB and I believe even 16 MiB chunks are possible,
tho I'm not sure what the exact minimum is.
Anyway, be sure and check mixed-mode too, because that's where I had my
problems, tho I'm not sure if it's where you had yours. But it could be
that the differing code path of mixed-mode misses that 10% check, which
would explain my problem, and possibly yours if that's what yours were.
Meanwhile, I might have some free time to do my own checks tomorrow.
It'd be worth it just to my own peace of mind to settle the issue,
since it frustrated me for so long.
--
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:[~2017-09-02 4:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-31 17:27 [btrfs-progs] Bug in mkfs.btrfs -r Goffredo Baroncelli
2017-08-31 18:49 ` Austin S. Hemmelgarn
2017-08-31 20:29 ` Goffredo Baroncelli
2017-09-01 11:49 ` Austin S. Hemmelgarn
2017-09-01 0:13 ` Qu Wenruo
2017-09-01 11:28 ` Austin S. Hemmelgarn
2017-09-01 11:49 ` Qu Wenruo
2017-09-01 12:05 ` Austin S. Hemmelgarn
2017-09-01 12:19 ` Qu Wenruo
2017-09-01 12:47 ` Austin S. Hemmelgarn
2017-09-01 13:54 ` Qu Wenruo
2017-09-01 14:07 ` Austin S. Hemmelgarn
2017-09-02 4:03 ` Duncan [this message]
2017-09-05 3:57 ` Duncan
2017-09-01 11:54 ` Qu Wenruo
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$9833c$c04b7334$d8bed9c4$4b7b46fb@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 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).