linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] memcg: Removed duplication detection for mem_cgroup_uncharge_swap
@ 2023-08-19  8:13 Lu Jialin
  2023-08-20  5:15 ` Shakeel Butt
  0 siblings, 1 reply; 2+ messages in thread
From: Lu Jialin @ 2023-08-19  8:13 UTC (permalink / raw)
  To: Johannes Weiner, Andrew Morton, Michal Hocko, Roman Gushchin,
	Shakeel Butt, Muchun Song
  Cc: Lu Jialin, cgroups, linux-mm

__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 <lujialin4@huawei.com>
---
 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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] memcg: Removed duplication detection for mem_cgroup_uncharge_swap
  2023-08-19  8:13 [PATCH] memcg: Removed duplication detection for mem_cgroup_uncharge_swap Lu Jialin
@ 2023-08-20  5:15 ` Shakeel Butt
  0 siblings, 0 replies; 2+ messages in thread
From: Shakeel Butt @ 2023-08-20  5:15 UTC (permalink / raw)
  To: Lu Jialin
  Cc: Johannes Weiner, Andrew Morton, Michal Hocko, Roman Gushchin,
	Muchun Song, cgroups, linux-mm

On Sat, Aug 19, 2023 at 1:14 AM Lu Jialin <lujialin4@huawei.com> wrote:
>
> __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 <lujialin4@huawei.com>

Acked-by: Shakeel Butt <shakeelb@google.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-20  5:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-19  8:13 [PATCH] memcg: Removed duplication detection for mem_cgroup_uncharge_swap Lu Jialin
2023-08-20  5:15 ` Shakeel Butt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox