Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Andrei Borzenkov <arvidjaar@gmail.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: Confused by btrfs quota group accounting
Date: Sun, 23 Jun 2019 21:55:18 +0800	[thread overview]
Message-ID: <0310c56a-6865-e561-41d0-4545845f4c58@gmx.com> (raw)
In-Reply-To: <63286845-0fc3-e595-3e35-e8e2bef4fd17@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2094 bytes --]



On 2019/6/23 下午9:42, Andrei Borzenkov wrote:
> 23.06.2019 14:29, Qu Wenruo пишет:
>>
>>
>> BTW, so many fragmented extents, this normally means your system has
>> very high memory pressure or lack of memory, or lack of on-disk space.
> 
> It is 1GiB QEMU VM with vanilla Tumbleweed with GNOME desktop; nothing
> runs except user GNOME session. Does it fit "high memory pressure"
> definition?

1GiB Vram? That's very easy to trigger memory pressure.
I'm not 100% sure about the percentage page cache can use, but 1/8 would
be a safe guess.
Which means, you can only write at most 128M before triggering writeback.
Considering other program uses some page cache, you have less available
page caches for filesystem.

> 
>> Above 100MiB should be in one large extent, not split into so many small
>> ones.
>>
> 
> OK, so this is where I was confused. I was sure that filefrag returns
> true "physical" extent layout. It seems that in filefrag output
> consecutive extents are merged giving false picture of large extent
> instead of many small ones. Filefrag shows 5 ~200MiB extents, not over
> 30 smaller ones.

Btrfs does file extent mapping merge at fiemap reporting time.
Personally speaking, I don't know why user would expect real extent mapping.
As long as the all these extents have the same flags, continuous
address, then merging them shouldn't be a problem.

In fact, after viewing the real on-disk extent mapping, it's possible to
explain just by the fiemap result, but using fiemap result alone is
indeed much harder to expose such case.

For your use case, it's already deep into the implementation, thus I
recommend low level tools like "btrfs ins dump-tree" to discover the
underlying extent mapping.

> 
> Is it how generic IOCTL is designed to work or is it something that
> btrfs does internally? This *is* confusing.
> 
> In any case, thank you for clarification, this makes sense now.

AFAIK, we should put this into the btrfs(5) man page as an special use
case. Along with btrfs extent booking.

Thanks,
Qu


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2019-06-23 13:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-22 15:11 Confused by btrfs quota group accounting Andrei Borzenkov
2019-06-23  7:55 ` Qu Wenruo
2019-06-23  8:08   ` Qu Wenruo
2019-06-23 10:15     ` Andrei Borzenkov
2019-06-23 11:29       ` Qu Wenruo
2019-06-23 13:42         ` Andrei Borzenkov
2019-06-23 13:55           ` Qu Wenruo [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=0310c56a-6865-e561-41d0-4545845f4c58@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=arvidjaar@gmail.com \
    --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