lkml.org 
[lkml]   [2019]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: memcontrol.c: move mem_cgroup_id_get_many under CONFIG_MMU
Hi Kuninori,

Michal Hocko writes:
>On Tue 17-12-19 15:47:40, Kuninori Morimoto wrote:
>> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>>
>> mem_cgroup_id_get_many() is used under CONFIG_MMU.
>
>Not really. It is used when SWAP is enabled currently. But it is not
>really bound to the swap functionality by any means. It just happens
>that we do not have other users currently. We might put it under
>CONFIG_SWAP but I do not really think it is a big improvement.

Agreed, I think we shouldn't wrap this in preprocessor conditionals it since
it's entirely possible it will end up used elsewhere and we'll end up with a
mess of #ifdefs.

>> This patch moves it to under CONFIG_MMU.
>> We will get below warning without this patch
>> if .config doesn't have CONFIG_MMU.
>>
>> LINUX/mm/memcontrol.c:4814:13: warning: 'mem_cgroup_id_get_many'\
>> defined but not used [-Wunused-function]
>> static void mem_cgroup_id_get_many(struct mem_cgroup *memcg, unsigned int n)
>> ^~~~~~~~~~~~~~~~~~~~~~
>
>Is this warning really a big deal? The function is not used, alright,
>and the compiler will likely just drop it.

Let's just add __maybe_unused, since it seems like what we want in this
scenario -- it avoids new users having to enter preprocessor madness, while
also not polluting the build output.

Once you've done that, I'll send over my ack. :-)

Thanks.

\
 
 \ /
  Last update: 2019-12-17 14:55    [W:0.044 / U:6.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site