]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
memcg: remove inc/dec_lruvec_kmem_state helpers
authorChen Ridong <chenridong@huawei.com>
Wed, 26 Nov 2025 02:04:35 +0000 (02:04 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 29 Nov 2025 18:41:10 +0000 (10:41 -0800)
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.

Link: https://lkml.kernel.org/r/20251126020435.1511637-1-chenridong@huaweicloud.com
Signed-off-by: Chen Ridong <chenridong@huawei.com>
Acked-by: Qi Zheng <zhengqi.arch@bytedance.com>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Lu Jialin <lujialin4@huawei.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Wei Xu <weixugc@google.com>
Cc: Yuanchu Xie <yuanchu@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/memcontrol.h
mm/workingset.c

index d35390f9892a607debe04ff0644f6ae0da714bd8..0651865a4564fab9feb5c1d1aa24bd9543826cbe 100644 (file)
@@ -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;
index 6ff30369b758e3e36276d6f8ed16df6b8a2167ad..1399d6da75a236ca8183e30251f00f7b9d0382de 100644 (file)
@@ -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);