From: Shakeel Butt <shakeel.butt@linux.dev>
To: Boris Burkov <boris@bur.io>
Cc: linux-btrfs@vger.kernel.org, linux-mm@kvack.org,
linux-fsdevel@vger.kernel.org, kernel-team@fb.com, wqu@suse.com,
willy@infradead.org
Subject: Re: [PATCH v2 1/3] mm/filemap: add AS_UNCHARGED
Date: Fri, 15 Aug 2025 17:41:35 -0700 [thread overview]
Message-ID: <363p6uyyrx5gruugrlq5kjxwz5gmw762s3nnem5nydkflwbhxy@jpnk4gxbpquj> (raw)
In-Reply-To: <38448707b0dfb7fabae28cbebba3481eec6f2f4e.1755300815.git.boris@bur.io>
On Fri, Aug 15, 2025 at 04:40:31PM -0700, Boris Burkov wrote:
> Btrfs currently tracks its metadata pages in the page cache, using a
> fake inode (fs_info->btree_inode) with offsets corresponding to where
> the metadata is stored in the filesystem's full logical address space.
>
> A consequence of this is that when btrfs uses filemap_add_folio(), this
> usage is charged to the cgroup of whichever task happens to be running
> at the time. These folios don't belong to any particular user cgroup, so
> I don't think it makes much sense for them to be charged in that way.
> Some negative consequences as a result:
> - A task can be holding some important btrfs locks, then need to lookup
> some metadata and go into reclaim, extending the duration it holds
> that lock for, and unfairly pushing its own reclaim pain onto other
> cgroups.
> - If that cgroup goes into reclaim, it might reclaim these folios a
> different non-reclaiming cgroup might need soon. This is naturally
> offset by LRU reclaim, but still.
>
> A very similar proposal to use the root cgroup was previously made by
> Qu, where he eventually proposed the idea of setting it per
> address_space. This makes good sense for the btrfs use case, as the
> uncharged behavior should apply to all use of the address_space, not
> select allocations. I.e., if someone adds another filemap_add_folio()
> call using btrfs's btree_inode, we would almost certainly want the
> uncharged behavior.
>
> Link: https://lore.kernel.org/linux-mm/b5fef5372ae454a7b6da4f2f75c427aeab6a07d6.1727498749.git.wqu@suse.com/
> Suggested-by: Qu Wenruo <wqu@suse.com>
> Signed-off-by: Boris Burkov <boris@bur.io>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
next prev parent reply other threads:[~2025-08-16 0:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-15 23:40 [PATCH v2 0/3] introduce uncharged file mapped folios Boris Burkov
2025-08-15 23:40 ` [PATCH v2 1/3] mm/filemap: add AS_UNCHARGED Boris Burkov
2025-08-16 0:41 ` Shakeel Butt [this message]
2025-08-15 23:40 ` [PATCH v2 2/3] mm: add vmstat for cgroup uncharged pages Boris Burkov
2025-08-16 0:48 ` Shakeel Butt
2025-08-16 0:54 ` Shakeel Butt
2025-08-15 23:40 ` [PATCH v2 3/3] btrfs: set AS_UNCHARGED on the btree_inode Boris Burkov
2025-08-16 0:50 ` Shakeel Butt
2025-08-16 12:52 ` David Sterba
2025-08-17 8:34 ` [syzbot ci] Re: introduce uncharged file mapped folios syzbot ci
2025-08-18 16:36 ` Shakeel Butt
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=363p6uyyrx5gruugrlq5kjxwz5gmw762s3nnem5nydkflwbhxy@jpnk4gxbpquj \
--to=shakeel.butt@linux.dev \
--cc=boris@bur.io \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.org \
--cc=wqu@suse.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