From: Johannes Weiner <hannes@cmpxchg.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Qu Wenruo <quwenruo.btrfs@gmx.com>, Qu Wenruo <wqu@suse.com>,
linux-btrfs@vger.kernel.org, mhocko@kernel.org,
roman.gushchin@linux.dev, shakeel.butt@linux.dev,
muchun.song@linux.dev, akpm@linux-foundation.org,
cgroups@vger.kernel.org, linux-mm@kvack.org,
Michal Hocko <mhocko@suse.com>,
"Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Subject: Re: [PATCH] btrfs: root memcgroup for metadata filemap_add_folio()
Date: Thu, 3 Oct 2024 16:58:53 -0400 [thread overview]
Message-ID: <20241003205853.GA1658449@cmpxchg.org> (raw)
In-Reply-To: <Zvz5KfmB8J90TLmO@infradead.org>
On Wed, Oct 02, 2024 at 12:41:29AM -0700, Christoph Hellwig wrote:
> > > This looks pretty ugly. What speaks against a version of
> > > filemap_add_folio that doesn't charge the memcg?
>
> What I'd propose is something like the patch below, plus proper
> documentation.
I like this much better as well.
> Note that this now does the uncharge on the unlocked folio in the
> error case. From a quick look that should be fine, but someone who
> actually knows the code needs to confirm that.
That's fine. For the same reason the non-atomic __folio_clear_locked()
is fine in that case. The folio just has to be exclusive.
prev parent reply other threads:[~2024-10-03 20:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-28 4:45 [PATCH] btrfs: root memcgroup for metadata filemap_add_folio() Qu Wenruo
2024-09-30 17:23 ` Shakeel Butt
2024-09-30 22:00 ` Qu Wenruo
2024-10-01 1:37 ` Shakeel Butt
2024-10-01 2:03 ` Qu Wenruo
2024-10-01 9:19 ` Christoph Hellwig
2024-10-01 9:40 ` Qu Wenruo
2024-10-02 7:41 ` Christoph Hellwig
2024-10-03 8:07 ` Michal Hocko
2024-10-03 20:39 ` Shakeel Butt
2024-10-03 8:11 ` Qu Wenruo
2024-10-03 8:22 ` Michal Hocko
2024-10-03 8:23 ` Qu Wenruo
2024-10-03 20:58 ` Johannes Weiner [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=20241003205853.GA1658449@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=hch@infradead.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=mhocko@suse.com \
--cc=muchun.song@linux.dev \
--cc=quwenruo.btrfs@gmx.com \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=vbabka@kernel.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 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.