From: Lu Jialin Subject: [PATCH] memcg: Removed duplication detection for mem_cgroup_uncharge_swap Date: Sat, 19 Aug 2023 08:13:02 +0000 Message-ID: <20230819081302.1217098-1-lujialin4@huawei.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7BIT Return-path: List-ID: Content-Type: text/plain; charset="us-ascii" To: Johannes Weiner , Andrew Morton , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song Cc: Lu Jialin , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org __mem_cgroup_uncharge_swap is only called in mem_cgroup_uncharge_swap, if mem cgroup is disabled, __mem_cgroup_uncharge_swap cannot be called. Therefore, there is no need to judge whether mem_cgroup is disabled or not. Signed-off-by: Lu Jialin --- mm/memcontrol.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index e8ca4bdcb03c..274af096c748 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -7535,9 +7535,6 @@ void __mem_cgroup_uncharge_swap(swp_entry_t entry, unsigned int nr_pages) struct mem_cgroup *memcg; unsigned short id; - if (mem_cgroup_disabled()) - return; - id = swap_cgroup_record(entry, 0, nr_pages); rcu_read_lock(); memcg = mem_cgroup_from_id(id); -- 2.34.1