From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFD7AEB64D9 for ; Fri, 7 Jul 2023 02:26:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232304AbjGGC0Q (ORCPT ); Thu, 6 Jul 2023 22:26:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230521AbjGGC0P (ORCPT ); Thu, 6 Jul 2023 22:26:15 -0400 Received: from out-22.mta1.migadu.com (out-22.mta1.migadu.com [IPv6:2001:41d0:203:375::16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A8D9DD for ; Thu, 6 Jul 2023 19:26:13 -0700 (PDT) Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1688696770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0xRLT9ea/2ScZsoJKQA4zG+jZgoWMbP6gLAC+IguOQ8=; b=Wf36/tDV+B1vbKdnbBZ3K4lf3PqmVLFmdnV05SyMbbAZQ3rrHLS+oJeEwM9jfj8Us3Bqd2 T9CB2agUUHRxpTTZBp1RhpB7BrW2H3eVlV/A0mG6izsBCPlunuGuLqRy0aYbExsdC5ELeQ VxY2I2256KXI+KJem9mlrCol+BHn8hA= MIME-Version: 1.0 Subject: Re: [PATCH] mm/memcg: remove definition of MEM_CGROUP_ID_MAX when !CONFIG_MEMCG X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <61ce2910-f3de-cfb7-bdd3-546ade0cb6f3@huawei.com> Date: Fri, 7 Jul 2023 10:25:35 +0800 Cc: Andrew Morton , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , cgroups@vger.kernel.org, LKML , Linux Memory Management List Content-Transfer-Encoding: quoted-printable Message-Id: <52C942A9-29F7-473F-8674-6CB584F009BA@linux.dev> References: <20230706112820.2393447-1-linmiaohe@huawei.com> <892B507C-CFE8-4792-BA5F-3C698290A8EE@linux.dev> <61ce2910-f3de-cfb7-bdd3-546ade0cb6f3@huawei.com> To: Miaohe Lin X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jul 7, 2023, at 10:06, Miaohe Lin wrote: >=20 > On 2023/7/7 9:47, Muchun Song wrote: >>=20 >>=20 >>> On Jul 6, 2023, at 19:28, Miaohe Lin wrote: >>>=20 >>> MEM_CGROUP_ID_MAX is only used when CONFIG_MEMCG is configured. = Remove >>> unneeded !CONFIG_MEMCG variant. >>>=20 >>> Signed-off-by: Miaohe Lin >>=20 >> 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: >>=20 >> #define MEM_CGROUP_ID_MAX ((1U << MEM_CGROUP_ID_SHIFT) - 1) >>=20 >> 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. >=20 > 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. >=20 >>=20 >> For this patch, LGTM. >>=20 >> Reviewed-by: Muchun Song >=20 > Thanks for review and suggestion. >=20 >=20 >=20