Message ID | 20210527062148.9361-20-songmuchun@bytedance.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=VCOr=KW=kvack.org=owner-linux-mm@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92C5CC47089 for <linux-mm@archiver.kernel.org>; Thu, 27 May 2021 06:26:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 40E606135F for <linux-mm@archiver.kernel.org>; Thu, 27 May 2021 06:26:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40E606135F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CF0556B0075; Thu, 27 May 2021 02:26:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CC6936B0087; Thu, 27 May 2021 02:26:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B68108D0001; Thu, 27 May 2021 02:26:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0089.hostedemail.com [216.40.44.89]) by kanga.kvack.org (Postfix) with ESMTP id 845D96B0075 for <linux-mm@kvack.org>; Thu, 27 May 2021 02:26:38 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 6BF31689A for <linux-mm@kvack.org>; Thu, 27 May 2021 06:26:37 +0000 (UTC) X-FDA: 78186027234.27.9DCB934 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by imf08.hostedemail.com (Postfix) with ESMTP id A25AD801912B for <linux-mm@kvack.org>; Thu, 27 May 2021 06:26:29 +0000 (UTC) Received: by mail-pj1-f47.google.com with SMTP id h20-20020a17090aa894b029015db8f3969eso1757950pjq.3 for <linux-mm@kvack.org>; Wed, 26 May 2021 23:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UxSxre2wDGLXpYpNahDKZAu3VAo2pfHZzOxhvD0wk18=; b=ZKubg9WZzxZUy30dowed69brRlvqEItapcPwLPgZswfpMdJ3cT/WDnRIkB4sOtsBvJ RF7PS1NNnnnkDwfJ3P+IMjR8tD0QZW8/88ZGllOgEBMnS1fbZYKJHaulTBoU99agPnhZ b7VcpA0nZy7pOhH05kUxqa4Rmfkw/fB2ALHIUiAxdfA17MOhOPuYft4X6x8pVDer+vG4 ojkmOtmZTMf9QhdmT0rqC8Xtx0DA1msBALyhiqnWNwMWBSYkuIsziIMZ80EwhJkKlu6T mAHy106uSOoAlzLgtccHS2Nfo2XjJSHM4jMD4f+S9fyOqzocjIqw4YphBEEcJT8RrEJu cyKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UxSxre2wDGLXpYpNahDKZAu3VAo2pfHZzOxhvD0wk18=; b=VAb/rXZQuoCHmdDj9dUhrR69rOA9DNvOQoDwBV9CCrbZxYjcK/y1Uh+Z2t+W3cV8P1 LMHHSbGouKh5et/pi50qrPP6Zo644LnwO3qafM0tFhZrLVgJE6JFOw9Z0UZFrQY6eagx 7Q7I9pCAHSsdoHArFUldM7hDqXrp/yefbaFve7BdfOJ4P7+coLsjNVAmmVAP5gGAKOal APa78z+8ztHsHmTR5u+NFTXBKh4biyyjiZYM7k7z38Zqd7gOevvIDCAVJIg5Ly6CZ1LI IdyimhAfajEavwiTcPpZJPL9ei2sqSS9x/MFVs5zlHwZTVrlJKpGYrMRTgmGFdKa717v BvVQ== X-Gm-Message-State: AOAM533FtwcMOJw3Zxz70NUksL3AfSp7LuqUaULLetmmqv9tdw/FQxHR T8AV22NKrbBQlf60G9Ji/R6+Yg== X-Google-Smtp-Source: ABdhPJyLAUuIAkmyYhUp7SVzVwB+y2sVQYdILO46NBcSQ91Ugrj375USQf1NBRX88v2oz8WRagoiDA== X-Received: by 2002:a17:90a:4a89:: with SMTP id f9mr7889513pjh.50.1622096796281; Wed, 26 May 2021 23:26:36 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.254]) by smtp.gmail.com with ESMTPSA id m5sm882971pgl.75.2021.05.26.23.26.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 May 2021 23:26:35 -0700 (PDT) From: Muchun Song <songmuchun@bytedance.com> To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, Muchun Song <songmuchun@bytedance.com> Subject: [PATCH v2 19/21] mm: memcontrol: fix cannot alloc the maximum memcg ID Date: Thu, 27 May 2021 14:21:46 +0800 Message-Id: <20210527062148.9361-20-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210527062148.9361-1-songmuchun@bytedance.com> References: <20210527062148.9361-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=ZKubg9WZ; spf=pass (imf08.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.47 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: A25AD801912B X-Stat-Signature: s6wz3oekrxdz83u34ijpc4oy3qbjb3rg X-HE-Tag: 1622096789-767846 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
Optimize list lru memory consumption
|
expand
|
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index ae3ad1001824..a1c8ec858593 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5044,7 +5044,7 @@ static struct mem_cgroup *mem_cgroup_alloc(void) return ERR_PTR(error); memcg->id.id = idr_alloc(&mem_cgroup_idr, NULL, - 1, MEM_CGROUP_ID_MAX, + 1, MEM_CGROUP_ID_MAX + 1, GFP_KERNEL); if (memcg->id.id < 0) { error = memcg->id.id;
The idr_alloc() does not include @max ID. So in the current implementation, the maximum memcg ID is 65534 instead of 65535. It seems a bug. So fix this. Signed-off-by: Muchun Song <songmuchun@bytedance.com> --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)