[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251126020435.1511637-1-chenridong@huaweicloud.com>
Date: Wed, 26 Nov 2025 02:04:35 +0000
From: Chen Ridong <chenridong@...weicloud.com>
To: hannes@...xchg.org,
mhocko@...nel.org,
roman.gushchin@...ux.dev,
shakeel.butt@...ux.dev,
muchun.song@...ux.dev,
akpm@...ux-foundation.org,
david@...nel.org,
zhengqi.arch@...edance.com,
lorenzo.stoakes@...cle.com,
axelrasmussen@...gle.com,
yuanchu@...gle.com,
weixugc@...gle.com
Cc: cgroups@...r.kernel.org,
linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
lujialin4@...wei.com,
chenridong@...wei.com
Subject: [PATCH -next] memcg: Remove inc/dec_lruvec_kmem_state helpers
From: Chen Ridong <chenridong@...wei.com>
The dec_lruvec_kmem_state helper is unused by any caller and can be safely
removed. Meanwhile, the inc_lruvec_kmem_state helper is only referenced by
shadow_lru_isolate, retaining these two helpers is unnecessary. This patch
removes both helper functions to eliminate redundant code.
Signed-off-by: Chen Ridong <chenridong@...wei.com>
---
include/linux/memcontrol.h | 10 ----------
mm/workingset.c | 2 +-
2 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index d35390f9892a..0651865a4564 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -1452,16 +1452,6 @@ struct slabobj_ext {
#endif
} __aligned(8);
-static inline void inc_lruvec_kmem_state(void *p, enum node_stat_item idx)
-{
- mod_lruvec_kmem_state(p, idx, 1);
-}
-
-static inline void dec_lruvec_kmem_state(void *p, enum node_stat_item idx)
-{
- mod_lruvec_kmem_state(p, idx, -1);
-}
-
static inline struct lruvec *parent_lruvec(struct lruvec *lruvec)
{
struct mem_cgroup *memcg;
diff --git a/mm/workingset.c b/mm/workingset.c
index 892f6fe94ea9..e9f05634747a 100644
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@ -749,7 +749,7 @@ static enum lru_status shadow_lru_isolate(struct list_head *item,
if (WARN_ON_ONCE(node->count != node->nr_values))
goto out_invalid;
xa_delete_node(node, workingset_update_node);
- inc_lruvec_kmem_state(node, WORKINGSET_NODERECLAIM);
+ mod_lruvec_kmem_state(node, WORKINGSET_NODERECLAIM, 1);
out_invalid:
xa_unlock_irq(&mapping->i_pages);
--
2.34.1
Powered by blists - more mailing lists