summaryrefslogtreecommitdiff
path: root/mm/workingset.c
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2017-05-03 14:55:13 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-05-03 15:52:11 -0700
commit71cd31135d4cf030a057ed7079a75a40c0a4a796 (patch)
treec95c8da1e70c21e412d9ab7328fc414ecfb80451 /mm/workingset.c
parentdf0e53d0619e83b465e363c088bf4eeb2848273b (diff)
downloadlinux-rpi-71cd31135d4cf030a057ed7079a75a40c0a4a796.tar.gz
linux-rpi-71cd31135d4cf030a057ed7079a75a40c0a4a796.tar.bz2
linux-rpi-71cd31135d4cf030a057ed7079a75a40c0a4a796.zip
mm: memcontrol: re-use node VM page state enum
The current duplication is a high-maintenance mess, and it's painful to add new items or query memcg state from the rest of the VM. This increases the size of the stat array marginally, but we should aim to track all these stats on a per-cgroup level anyway. Link: http://lkml.kernel.org/r/20170404220148.28338-3-hannes@cmpxchg.org Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Vladimir Davydov <vdavydov.dev@gmail.com> Cc: Michal Hocko <mhocko@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/workingset.c')
-rw-r--r--mm/workingset.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/mm/workingset.c b/mm/workingset.c
index 51c6f61d4cea..37fc1057cd86 100644
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@ -289,11 +289,11 @@ bool workingset_refault(void *shadow)
refault_distance = (refault - eviction) & EVICTION_MASK;
inc_node_state(pgdat, WORKINGSET_REFAULT);
- mem_cgroup_inc_stat(memcg, MEMCG_WORKINGSET_REFAULT);
+ mem_cgroup_inc_stat(memcg, WORKINGSET_REFAULT);
if (refault_distance <= active_file) {
inc_node_state(pgdat, WORKINGSET_ACTIVATE);
- mem_cgroup_inc_stat(memcg, MEMCG_WORKINGSET_ACTIVATE);
+ mem_cgroup_inc_stat(memcg, WORKINGSET_ACTIVATE);
rcu_read_unlock();
return true;
}
@@ -475,8 +475,7 @@ static enum lru_status shadow_lru_isolate(struct list_head *item,
if (WARN_ON_ONCE(node->exceptional))
goto out_invalid;
inc_node_state(page_pgdat(virt_to_page(node)), WORKINGSET_NODERECLAIM);
- mem_cgroup_inc_page_stat(virt_to_page(node),
- MEMCG_WORKINGSET_NODERECLAIM);
+ mem_cgroup_inc_page_stat(virt_to_page(node), WORKINGSET_NODERECLAIM);
__radix_tree_delete_node(&mapping->page_tree, node,
workingset_update_node, mapping);