[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201009135104.39048-1-linmiaohe@huawei.com>
Date: Fri, 9 Oct 2020 09:51:04 -0400
From: Miaohe Lin <linmiaohe@...wei.com>
To: <akpm@...ux-foundation.org>, <hannes@...xchg.org>,
<mhocko@...nel.org>, <vdavydov.dev@...il.com>
CC: <cgroups@...r.kernel.org>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>, <linmiaohe@...wei.com>
Subject: [PATCH] mm: memcontrol: eliminate redundant check in __mem_cgroup_insert_exceeded()
The mz->usage_in_excess >= mz_node->usage_in_excess check is exactly the
else case of mz->usage_in_excess < mz_node->usage_in_excess. So we could
replace else if (mz->usage_in_excess >= mz_node->usage_in_excess) with else
equally.
Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
---
mm/memcontrol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 2636f8bad908..f607afd0fcbf 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -629,7 +629,7 @@ static void __mem_cgroup_insert_exceeded(struct mem_cgroup_per_node *mz,
* We can't avoid mem cgroups that are over their soft
* limit by the same amount
*/
- else if (mz->usage_in_excess >= mz_node->usage_in_excess)
+ else
p = &(*p)->rb_right;
}
--
2.19.1
Powered by blists - more mailing lists