memcg: remove duplication detection for mem_cgroup_uncharge_swap
authorLu Jialin <lujialin4@huawei.com>
Sat, 19 Aug 2023 08:13:02 +0000 (08:13 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 24 Aug 2023 23:20:29 +0000 (16:20 -0700)
__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.

Link: https://lkml.kernel.org/r/20230819081302.1217098-1-lujialin4@huawei.com
Signed-off-by: Lu Jialin <lujialin4@huawei.com>
Acked-by: Shakeel Butt <shakeelb@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memcontrol.c

index cf57fe9318d55e29df08c155a42fdba76cb76011..0286bd0ab043d267de7d4a569c969fc7067d3757 100644 (file)
@@ -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);