Re: [PATCH v7 1/3] memcontrol: define root_mem_cgroup for CONFIG_MEMCG=n cases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





在 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





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux