Skip to content

Commit f3b566d

Browse files
Chen Ridongakpm00
authored andcommitted
memcg: remove inc/dec_lruvec_kmem_state helpers
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>
1 parent 0384c8e commit f3b566d

2 files changed

Lines changed: 1 addition & 11 deletions

File tree

include/linux/memcontrol.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,16 +1452,6 @@ struct slabobj_ext {
14521452
#endif
14531453
} __aligned(8);
14541454

1455-
static inline void inc_lruvec_kmem_state(void *p, enum node_stat_item idx)
1456-
{
1457-
mod_lruvec_kmem_state(p, idx, 1);
1458-
}
1459-
1460-
static inline void dec_lruvec_kmem_state(void *p, enum node_stat_item idx)
1461-
{
1462-
mod_lruvec_kmem_state(p, idx, -1);
1463-
}
1464-
14651455
static inline struct lruvec *parent_lruvec(struct lruvec *lruvec)
14661456
{
14671457
struct mem_cgroup *memcg;

mm/workingset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ static enum lru_status shadow_lru_isolate(struct list_head *item,
749749
if (WARN_ON_ONCE(node->count != node->nr_values))
750750
goto out_invalid;
751751
xa_delete_node(node, workingset_update_node);
752-
inc_lruvec_kmem_state(node, WORKINGSET_NODERECLAIM);
752+
mod_lruvec_kmem_state(node, WORKINGSET_NODERECLAIM, 1);
753753

754754
out_invalid:
755755
xa_unlock_irq(&mapping->i_pages);

0 commit comments

Comments
 (0)