From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Michal Hocko <mhocko@suse.com>, Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org, hannes@cmpxchg.org,
roman.gushchin@linux.dev, shakeel.butt@linux.dev,
muchun.song@linux.dev, cgroups@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH v7 1/3] memcontrol: define root_mem_cgroup for CONFIG_MEMCG=n cases
Date: Sat, 20 Jul 2024 07:28:45 +0930 [thread overview]
Message-ID: <54b7d944-37eb-4c3f-a994-13212aa3ed13@gmx.com> (raw)
In-Reply-To: <ZppKZJKMcPF4OGVc@tiehlicka>
在 2024/7/19 20:43, Michal Hocko 写道:
> On Fri 19-07-24 19:58:39, Qu Wenruo wrote:
>> There is an incoming btrfs patchset, which will use @root_mem_cgroup as
>> the active cgroup to attach metadata folios to its internal btree
>> inode, so that btrfs can skip the possibly costly charge for the
>> internal inode which is only accessible by btrfs itself.
>>
>> However @root_mem_cgroup is not always defined (not defined for
>> CONFIG_MEMCG=n case), thus all such callers need to do the extra
>> handling for different CONFIG_MEMCG settings.
>>
>> So here we add a special macro definition of root_mem_cgroup, making it
>> to always be NULL.
>
> Isn't just a declaration sufficient? Nothing should really dereference
> the pointer anyway.
>
That can pass the compile, but waste the extra bytes for the pointer in
the data section, even if no one is utilizing that pointer.
Thanks,
Qu
next prev parent reply other threads:[~2024-07-19 21:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-19 10:28 [PATCH v7 0/3] btrfs: try to allocate larger folios for metadata Qu Wenruo
2024-07-19 10:28 ` [PATCH v7 1/3] memcontrol: define root_mem_cgroup for CONFIG_MEMCG=n cases Qu Wenruo
2024-07-19 11:13 ` Michal Hocko
2024-07-19 21:58 ` Qu Wenruo [this message]
2024-07-22 7:32 ` Michal Hocko
2024-07-19 10:28 ` [PATCH v7 2/3] btrfs: always uses root memcgroup for filemap_add_folio() Qu Wenruo
2024-07-19 17:02 ` Johannes Weiner
2024-07-19 17:25 ` Roman Gushchin
2024-07-19 18:13 ` Michal Hocko
2024-07-19 22:11 ` Qu Wenruo
2024-07-22 7:34 ` Michal Hocko
2024-07-22 8:08 ` Qu Wenruo
2024-07-24 3:46 ` Qu Wenruo
2024-07-19 10:28 ` [PATCH v7 3/3] 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=54b7d944-37eb-4c3f-a994-13212aa3ed13@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--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