Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Michal Hocko <mhocko@suse.com>, 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 16:46:50 +0930	[thread overview]
Message-ID: <99334ebf-583a-4295-be52-118c253d5fca@gmx.com> (raw)
In-Reply-To: <ZpoQ_28XHCUO9_TT@tiehlicka>



在 2024/7/19 16:38, Michal Hocko 写道:
> 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

My bad.

I'll fix it from the btrfs part so that @root_mem_cgroup would be
changed to NULL for the CONFIG_MEMCG=n case.

Meanwhile, can we just define root_mem_cgroup as NULL globally?
That looks more reasonable to me, and if that's fine I can send out an
extra patch just for that.

Thanks,
Qu

>
>>   	if (!ret)
>>   		goto finish;
>>
>> --
>> 2.45.2
>

  reply	other threads:[~2024-07-19  7:17 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
2024-07-19  7:16     ` Qu Wenruo [this message]
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=99334ebf-583a-4295-be52-118c253d5fca@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mhocko@suse.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox