Skip to content

Commit 4715c6a

Browse files
shakeelbakpm00
authored andcommitted
mm: cleanup WORKINGSET_NODES in workingset
WORKINGSET_NODES is not exposed in the memcg stats and thus there is no need to use the memcg specific stat update functions for it. In future if we decide to expose WORKINGSET_NODES in the memcg stats, we can revert this patch. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Shakeel Butt <[email protected]> Reviewed-by: Roman Gushchin <[email protected]> Reviewed-by: T.J. Mercier <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Muchun Song <[email protected]> Cc: Yosry Ahmed <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 0667c78 commit 4715c6a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mm/workingset.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ struct list_lru shadow_nodes;
618618
void workingset_update_node(struct xa_node *node)
619619
{
620620
struct address_space *mapping;
621+
struct page *page = virt_to_page(node);
621622

622623
/*
623624
* Track non-empty nodes that contain only shadow entries;
@@ -633,12 +634,12 @@ void workingset_update_node(struct xa_node *node)
633634
if (node->count && node->count == node->nr_values) {
634635
if (list_empty(&node->private_list)) {
635636
list_lru_add_obj(&shadow_nodes, &node->private_list);
636-
__inc_lruvec_kmem_state(node, WORKINGSET_NODES);
637+
__inc_node_page_state(page, WORKINGSET_NODES);
637638
}
638639
} else {
639640
if (!list_empty(&node->private_list)) {
640641
list_lru_del_obj(&shadow_nodes, &node->private_list);
641-
__dec_lruvec_kmem_state(node, WORKINGSET_NODES);
642+
__dec_node_page_state(page, WORKINGSET_NODES);
642643
}
643644
}
644645
}
@@ -742,7 +743,7 @@ static enum lru_status shadow_lru_isolate(struct list_head *item,
742743
}
743744

744745
list_lru_isolate(lru, item);
745-
__dec_lruvec_kmem_state(node, WORKINGSET_NODES);
746+
__dec_node_page_state(virt_to_page(node), WORKINGSET_NODES);
746747

747748
spin_unlock(lru_lock);
748749

0 commit comments

Comments
 (0)