Skip to content

Commit 14a405c

Browse files
Lu Jialinakpm00
authored andcommitted
memcg: remove duplication detection for mem_cgroup_uncharge_swap
__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>
1 parent 07e09c4 commit 14a405c

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

mm/memcontrol.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7535,9 +7535,6 @@ void __mem_cgroup_uncharge_swap(swp_entry_t entry, unsigned int nr_pages)
75357535
struct mem_cgroup *memcg;
75367536
unsigned short id;
75377537

7538-
if (mem_cgroup_disabled())
7539-
return;
7540-
75417538
id = swap_cgroup_record(entry, 0, nr_pages);
75427539
rcu_read_lock();
75437540
memcg = mem_cgroup_from_id(id);

0 commit comments

Comments
 (0)