From: Michal Hocko <mhocko@suse.com>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org, Vlastimil Babka <vbabka@kernel.org>
Subject: Re: [PATCH v5 1/2] btrfs: always uses root memcgroup for filemap_add_folio()
Date: Fri, 19 Jul 2024 09:08:47 +0200 [thread overview]
Message-ID: <ZpoQ_28XHCUO9_TT@tiehlicka> (raw)
In-Reply-To: <d408a1b35307101e82a6845e26af4a122c8e5a25.1721363035.git.wqu@suse.com>
On Fri 19-07-24 14:19:05, Qu Wenruo wrote:
[...]
> @@ -2981,8 +2982,17 @@ static int attach_eb_folio_to_filemap(struct extent_buffer *eb, int i,
> ASSERT(eb->folios[i]);
>
> retry:
> + /*
> + * Btree inode is a btrfs internal inode, and not exposed to any
> + * user.
> + * Furthermore we do not want any cgroup limits on this inode.
> + * So we always use root_mem_cgroup as our active memcg when attaching
> + * the folios.
> + */
> + old_memcg = set_active_memcg(root_mem_cgroup);
> ret = filemap_add_folio(mapping, eb->folios[i], index + i,
> GFP_NOFS | __GFP_NOFAIL);
> + set_active_memcg(old_memcg);
I do not think this will compile with CONFIG_MEMCG=n
> if (!ret)
> goto finish;
>
> --
> 2.45.2
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2024-07-19 7:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-19 4:49 [PATCH v5 0/2] btrfs: try to allocate larger folios for metadata Qu Wenruo
2024-07-19 4:49 ` [PATCH v5 1/2] btrfs: always uses root memcgroup for filemap_add_folio() Qu Wenruo
2024-07-19 7:08 ` Michal Hocko [this message]
2024-07-19 7:16 ` Qu Wenruo
2024-07-19 7:20 ` Qu Wenruo
2024-07-19 7:26 ` Michal Hocko
2024-07-19 15:42 ` kernel test robot
2024-07-19 15:42 ` kernel test robot
2024-07-19 4:49 ` [PATCH v5 2/2] btrfs: prefer to allocate larger folio for metadata 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=ZpoQ_28XHCUO9_TT@tiehlicka \
--to=mhocko@suse.com \
--cc=linux-btrfs@vger.kernel.org \
--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.