[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230419092007.186938-1-haifeng.xu@shopee.com>
Date: Wed, 19 Apr 2023 09:20:07 +0000
From: Haifeng Xu <haifeng.xu@...pee.com>
To: mhocko@...e.com
Cc: hannes@...xchg.org, roman.gushchin@...ux.dev, shakeelb@...gle.com,
akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Haifeng Xu <haifeng.xu@...pee.com>
Subject: [PATCH] mm, vmpressure: remove redundant check in vmpressure()
There are three places, vmpressure_prio(), shrink_node_memcgs() and
shrink_node(), which invoke vmpressure(). But only shrink_node_memcgs()
sets tree to false and the memcg used in it is not NULL, so we don't
check it again in vmpressure().
Signed-off-by: Haifeng Xu <haifeng.xu@...pee.com>
---
mm/vmpressure.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/vmpressure.c b/mm/vmpressure.c
index b52644771cc4..3e4251a55e56 100644
--- a/mm/vmpressure.c
+++ b/mm/vmpressure.c
@@ -284,7 +284,7 @@ void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, bool tree,
enum vmpressure_levels level;
/* For now, no users for root-level efficiency */
- if (!memcg || mem_cgroup_is_root(memcg))
+ if (mem_cgroup_is_root(memcg))
return;
spin_lock(&vmpr->sr_lock);
--
2.25.1
Powered by blists - more mailing lists