From: Muchun Song <muchun.song@linux.dev>
To: Miaohe Lin <linmiaohe@huawei.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Shakeel Butt <shakeelb@google.com>,
cgroups@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [PATCH] mm/memcg: remove definition of MEM_CGROUP_ID_MAX when !CONFIG_MEMCG
Date: Fri, 7 Jul 2023 10:25:35 +0800 [thread overview]
Message-ID: <52C942A9-29F7-473F-8674-6CB584F009BA@linux.dev> (raw)
In-Reply-To: <61ce2910-f3de-cfb7-bdd3-546ade0cb6f3@huawei.com>
> On Jul 7, 2023, at 10:06, Miaohe Lin <linmiaohe@huawei.com> wrote:
>
> On 2023/7/7 9:47, Muchun Song wrote:
>>
>>
>>> On Jul 6, 2023, at 19:28, Miaohe Lin <linmiaohe@huawei.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@huawei.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?
I think it's better to squash.
>
>>
>> For this patch, LGTM.
>>
>> Reviewed-by: Muchun Song <songmuchun@bytedance.com>
>
> Thanks for review and suggestion.
>
>
>
next prev parent reply other threads:[~2023-07-07 2:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-06 11:28 Miaohe Lin
2023-07-07 1:47 ` Muchun Song
2023-07-07 2:06 ` Miaohe Lin
2023-07-07 2:25 ` Muchun Song [this message]
2023-07-07 2:38 ` Miaohe Lin
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=52C942A9-29F7-473F-8674-6CB584F009BA@linux.dev \
--to=muchun.song@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=roman.gushchin@linux.dev \
--cc=shakeelb@google.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