From patchwork Mon Mar 14 23:30:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 12780875 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 B667BC433F5 for ; Mon, 14 Mar 2022 23:30:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0C1638D0001; Mon, 14 Mar 2022 19:30:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0727B6B0072; Mon, 14 Mar 2022 19:30:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E7B228D0001; Mon, 14 Mar 2022 19:30:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0207.hostedemail.com [216.40.44.207]) by kanga.kvack.org (Postfix) with ESMTP id D919F6B0071 for ; Mon, 14 Mar 2022 19:30:34 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 6DA24A2AF1 for ; Mon, 14 Mar 2022 23:30:34 +0000 (UTC) X-FDA: 79244588388.25.6639DB5 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) by imf18.hostedemail.com (Postfix) with ESMTP id 0CFD31C000C for ; Mon, 14 Mar 2022 23:30:33 +0000 (UTC) Received: by mail-ed1-f45.google.com with SMTP id c25so19909262edj.13 for ; Mon, 14 Mar 2022 16:30:33 -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=qHm6ns4crCOcaBTwUjMbD9FaBOK99gvm+HsOLXP9V1E=; b=GycEiFI15k/dqMhfJjR5ur8JChRl8fpPp3zxafdxMdTo8IE65VlLRln1bxzKQR0yRV IRUl8aJyCZ3Yalh2hP95Elt0JT3mj52pUKnBGcN5oL6JSHPXLWbKhYqoWGuLCd2LRoap VLZAJtKHGOZiZs1Vu3S7xYbcWe9a7d5iUA2qSwP5fGI8cEm2ZizJqD6ht5727y8diLKr 5HvdYqgHcxB96axrmWl2/eedK4zl0501ed8ynA2oOd+6CWeik/01RXhGSNc5ObvPt3Ly 87qSVVzFtjzq1XS4o6flLzE5r77BwZjPIO1k/GEEiNsMmstlAsvfVe1NseGCgp7Sy4xL OnDA== 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=qHm6ns4crCOcaBTwUjMbD9FaBOK99gvm+HsOLXP9V1E=; b=Ucm83RhXrexRBwoB31GxDumDdSmyK267sMz8T4kVu3jbpSOlz5LIOVPs46aPTcVXmx ZwysjZEwE6vinFMyQfrkI5Dyg8JzRjeSc26u2IG1vF/sX8Q9hlmAAxKVBKPJ+sl/wmGm Oo1WifHF84C/OlhfIMYsh5UyrcFnaTQ+ScvN0Kn+wrGdOkqZnkyqT+Ondnp/bn1qr1Fj OzVM8F/la4fXdu15a/2K1ZSQUebZtOf9pyikMB4MIwC/a4h2jVf8KDnDJpjMhn/yiAVH diodMwStn613TkWuEhKjU8WayCTiuGn60FCAgx9x45QcLpjWqYoQ2ERPydZrsuPZsbXM 74PA== X-Gm-Message-State: AOAM530ZKZNBaXLu1uvqFDQpY4qfQ99ZBUE22ROkM7lNKaeErkRg9nD2 2KX7ACLuuPw/l69zA27qNjo= X-Google-Smtp-Source: ABdhPJxx2AL7sfD2+cvjeAOS3rZprmNqp3tp0jVsDzyN6cbSnTIKphYgUW/pnVahzky+WMgydova3A== X-Received: by 2002:a50:9d47:0:b0:40f:9d3d:97b6 with SMTP id j7-20020a509d47000000b0040f9d3d97b6mr22477433edk.392.1647300632638; Mon, 14 Mar 2022 16:30:32 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id u24-20020a1709064ad800b006d70e40bd9esm7404844ejt.15.2022.03.14.16.30.32 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Mar 2022 16:30:32 -0700 (PDT) From: Wei Yang To: hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, akpm@linux-foundation.org Cc: cgroups@vger.kernel.org, linux-mm@kvack.org, Wei Yang Subject: [Patch v3] mm/memcg: mz already removed from rb_tree if not NULL Date: Mon, 14 Mar 2022 23:30:30 +0000 Message-Id: <20220314233030.12334-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 0CFD31C000C Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=GycEiFI1; spf=pass (imf18.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.45 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: X-Stat-Signature: zr6w94wycxskid6xy8xpeouu6yzm65pu X-HE-Tag: 1647300633-372265 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: When mz is not NULL, it means mz can either come from mem_cgroup_largest_soft_limit_node or __mem_cgroup_largest_soft_limit_nod. And both of them has removed this node by __mem_cgroup_remove_exceeded(). Not necessary to call __mem_cgroup_remove_exceeded() again. [fmhocko@suse.com: refine changelog] Acked-by: Michal Hocko Signed-off-by: Wei Yang --- mm/memcontrol.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index dc225ca512f6..e803ff02aae2 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3460,7 +3460,6 @@ unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order, nr_reclaimed += reclaimed; *total_scanned += nr_scanned; spin_lock_irq(&mctz->lock); - __mem_cgroup_remove_exceeded(mz, mctz); /* * If we failed to reclaim anything from this memory cgroup