[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 7 Jul 2023 10:06:49 +0800
From: Miaohe Lin <linmiaohe@...wei.com>
To: Muchun Song <muchun.song@...ux.dev>
CC: Andrew Morton <akpm@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Shakeel Butt <shakeelb@...gle.com>, <cgroups@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Linux Memory Management List <linux-mm@...ck.org>
Subject: Re: [PATCH] mm/memcg: remove definition of MEM_CGROUP_ID_MAX when
!CONFIG_MEMCG
On 2023/7/7 9:47, Muchun Song wrote:
>
>
>> On Jul 6, 2023, at 19:28, Miaohe Lin <linmiaohe@...wei.com> wrote:
>>
>> MEM_CGROUP_ID_MAX is only used when CONFIG_MEMCG is configured. Remove
>> unneeded !CONFIG_MEMCG variant.
>>
>> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
>
> MEM_CGROUP_ID_MAX is also only used in mem_cgroup_alloc(), maybe you also
> could move it from memcontrol.h to memcontrol.c. And define it as:
>
> #define MEM_CGROUP_ID_MAX ((1U << MEM_CGROUP_ID_SHIFT) - 1)
>
> I am not suggesting defining it as USHRT_MAX, because if someone changes
> MEM_CGROUP_ID_SHIFT in the future, then MEM_CGROUP_ID_MAX will not updated
> accordingly.
Looks sensible to me. Do you suggest squashing above changes into the current patch
or a separate patch is preferred?
>
> For this patch, LGTM.
>
> Reviewed-by: Muchun Song <songmuchun@...edance.com>
Thanks for review and suggestion.
Powered by blists - more mailing lists