From patchwork Sun Apr 3 02:08:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 12799450 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B0CDC433F5 for ; Sun, 3 Apr 2022 02:09:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CD8BB6B0071; Sat, 2 Apr 2022 22:09:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C86126B0072; Sat, 2 Apr 2022 22:09:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B4F4E6B0073; Sat, 2 Apr 2022 22:09:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id A26266B0071 for ; Sat, 2 Apr 2022 22:09:00 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 5988620418 for ; Sun, 3 Apr 2022 02:08:49 +0000 (UTC) X-FDA: 79313934378.01.3BAB3CE Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by imf31.hostedemail.com (Postfix) with ESMTP id 1E2C22001C for ; Sun, 3 Apr 2022 02:08:48 +0000 (UTC) Received: by mail-ej1-f49.google.com with SMTP id yy13so13372563ejb.2 for ; Sat, 02 Apr 2022 19:08:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=C7M3sxnNh9ju9tb2x0yLZLDmlvAi9UQAlTWRcM/JN90=; b=iw1q4VQH1xO+kN+VCt9RffVSCNxDWS53ujTgERnK+15z2eisOdiIC7FaCeeWhxumRi Tbx2nAEMNJj7OdLQQYC6hr2oMKRnVDUtVyvRAzYV6gnzpsVSS+xfiTcE/0acVLcxwqy9 SONTxEpBrvtds2Lxz+Zh8zmGvWmkClCwiOS4QGpAB6ssxp5AdbC09+EeB9Y8kVAL4U25 Fc3NLRSS4OI6B5++JH22GH3nnm7ZOlx/2n84xGBg8NNey7eG078CslnwvBzweEPzohKf LuVCEtvp3zA8lMQKUah3SB68McfJNek0VUc+lxRkfxjKHdntX4e0bjdDXZizwM46EYe9 2TrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=C7M3sxnNh9ju9tb2x0yLZLDmlvAi9UQAlTWRcM/JN90=; b=nzl0PNdUMnfZ72ZfzSyE1ipSXZh1+cMrYSsq8zgzLXAq5E9CAUbGQv0RwKhM5K3NzE VSNFWaa/xcoRuAddqaIwcJG9wzgGlik6M/ThXdp228qMwc3UeOm/le3THLJ5rxhp/oCB s09LhQqepzk2nvpdD7odXuJPEI+6ls3/BGF76Z/ma4BT6ysZGWwz6Wy0PXCAjZFzZnrI eTsHPtZiORqbdJSmQqc0e3j8JcAB+GVrFqkG/y4buFYYmDnhqdbi62Z+7GhaibIt6jKd RE4fmClEtuXKVmosxv0qDh8Vl9/MRivumngPmyM/qjhgmviuhNCxzjhBG64XUeY9ZTDY JI+w== X-Gm-Message-State: AOAM531Vw1jGvKJBFNDnxjdBSHuKH2StovPVczk9cemQsGE7PG/5ltZB uuoO4rMInZpceRnayVlkGdM= X-Google-Smtp-Source: ABdhPJzPihh5MnM9zl87IEzyXxnubntZliOJ1aSl0fp3Aq0FzR0SpueXYx0GhjTzS6VRJ52xxVrtrA== X-Received: by 2002:a17:906:ae0b:b0:6df:c7d6:9235 with SMTP id le11-20020a170906ae0b00b006dfc7d69235mr5708345ejb.664.1648951727733; Sat, 02 Apr 2022 19:08:47 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id c13-20020a17090654cd00b006e0db351d01sm2692639ejp.124.2022.04.02.19.08.46 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Apr 2022 19:08:47 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org Cc: cgroups@vger.kernel.org, linux-mm@kvack.org, Wei Yang , Roman Gushchin , Johannes Weiner Subject: [PATCH] mm/memcg: non-hierarchical mode is deprecated Date: Sun, 3 Apr 2022 02:08:33 +0000 Message-Id: <20220403020833.26164-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 1E2C22001C X-Stat-Signature: xy6e7tqo4twi18fo7eyro5kb48e1czj7 X-Rspam-User: Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=iw1q4VQH; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf31.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.49 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com X-HE-Tag: 1648951728-686415 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: After commit bef8620cd8e0 ("mm: memcg: deprecate the non-hierarchical mode"), we won't have a NULL parent except root_mem_cgroup. And this case is handled when (memcg == root). Signed-off-by: Wei Yang CC: Roman Gushchin CC: Johannes Weiner Acked-by: Michal Hocko Reviewed-by: Roman Gushchin Reviewed-by: Shakeel Butt --- mm/memcontrol.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 2cd8bfdec379..3ceb9b8592b1 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6587,9 +6587,6 @@ void mem_cgroup_calculate_protection(struct mem_cgroup *root, return; parent = parent_mem_cgroup(memcg); - /* No parent means a non-hierarchical mode on v1 memcg */ - if (!parent) - return; if (parent == root) { memcg->memory.emin = READ_ONCE(memcg->memory.min);