[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241210092805.87281-2-ryncsn@gmail.com>
Date: Tue, 10 Dec 2024 17:28:03 +0800
From: Kairui Song <ryncsn@...il.com>
To: linux-mm@...ck.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Chris Li <chrisl@...nel.org>,
Hugh Dickins <hughd@...gle.com>,
"Huang, Ying" <ying.huang@...ux.alibaba.com>,
Yosry Ahmed <yosryahmed@...gle.com>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Shakeel Butt <shakeel.butt@...ux.dev>,
Johannes Weiner <hannes@...xchg.org>,
Barry Song <baohua@...nel.org>,
Michal Hocko <mhocko@...nel.org>,
linux-kernel@...r.kernel.org,
Kairui Song <kasong@...cent.com>
Subject: [PATCH v2 1/3] mm, memcontrol: avoid duplicated memcg enable check
From: Kairui Song <kasong@...cent.com>
mem_cgroup_uncharge_swap() includes a mem_cgroup_disabled() check,
so the caller doesn't need to check that.
Signed-off-by: Kairui Song <kasong@...cent.com>
Reviewed-by: Yosry Ahmed <yosryahmed@...gle.com>
Reviewed-by: Roman Gushchin <roman.gushchin@...ux.dev>
Acked-by: Shakeel Butt <shakeel.butt@...ux.dev>
Acked-by: Chris Li <chrisl@...nel.org>
---
mm/memcontrol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 7b3503d12aaf..79900a486ed1 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4609,7 +4609,7 @@ void mem_cgroup_swapin_uncharge_swap(swp_entry_t entry, unsigned int nr_pages)
* correspond 1:1 to page and swap slot lifetimes: we charge the
* page to memory here, and uncharge swap when the slot is freed.
*/
- if (!mem_cgroup_disabled() && do_memsw_account()) {
+ if (do_memsw_account()) {
/*
* The swap entry might not get freed for a long time,
* let's not wait for it. The page already received a
--
2.47.1
Powered by blists - more mailing lists