public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
From: Muchun Song <muchun.song-fxUVXftIFDnyG1zEObXtfA@public.gmane.org>
To: Miaohe Lin <linmiaohe-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
	Michal Hocko <mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Roman Gushchin
	<roman.gushchin-fxUVXftIFDnyG1zEObXtfA@public.gmane.org>,
	Shakeel Butt <shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux Memory Management List
	<linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.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-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>



> On Jul 7, 2023, at 10:06, Miaohe Lin <linmiaohe-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> wrote:
> 
> On 2023/7/7 9:47, Muchun Song wrote:
>> 
>> 
>>> On Jul 6, 2023, at 19:28, Miaohe Lin <linmiaohe-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> wrote:
>>> 
>>> MEM_CGROUP_ID_MAX is only used when CONFIG_MEMCG is configured. Remove
>>> unneeded !CONFIG_MEMCG variant.
>>> 
>>> Signed-off-by: Miaohe Lin <linmiaohe-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
>> 
>> 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-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>
> 
> Thanks for review and suggestion.
> 
> 
> 


  parent reply	other threads:[~2023-07-07  2:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06 11:28 [PATCH] mm/memcg: remove definition of MEM_CGROUP_ID_MAX when !CONFIG_MEMCG Miaohe Lin
2023-07-07  1:47 ` Muchun Song
     [not found]   ` <892B507C-CFE8-4792-BA5F-3C698290A8EE-fxUVXftIFDnyG1zEObXtfA@public.gmane.org>
2023-07-07  2:06     ` Miaohe Lin
     [not found]       ` <61ce2910-f3de-cfb7-bdd3-546ade0cb6f3-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2023-07-07  2:25         ` Muchun Song [this message]
     [not found]           ` <52C942A9-29F7-473F-8674-6CB584F009BA-fxUVXftIFDnyG1zEObXtfA@public.gmane.org>
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-fxuvxftifdnyg1zeobxtfa@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
    --cc=linmiaohe-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    --cc=mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=roman.gushchin-fxUVXftIFDnyG1zEObXtfA@public.gmane.org \
    --cc=shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    /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