The patch titled Subject: mm: memcontrol: replace node summing with memcg_page_state() has been added to the -mm tree. Its filename is mm-memcontrol-replace-node-summing-with-memcg_page_state.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-memcontrol-replace-node-summing-with-memcg_page_state.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-memcontrol-replace-node-summing-with-memcg_page_state.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Johannes Weiner <hannes@xxxxxxxxxxx> Subject: mm: memcontrol: replace node summing with memcg_page_state() Instead of adding up the node counters, use memcg_page_state() to get the memcg state directly. This is a bit cheaper and more stream-lined. Link: http://lkml.kernel.org/r/20190228163020.24100-4-hannes@xxxxxxxxxxx Signed-off-by: Johannes Weiner <hannes@xxxxxxxxxxx> Reviewed-by: Roman Gushchin <guro@xxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxxxx> Cc: Tejun Heo <tj@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memcontrol.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/mm/memcontrol.c~mm-memcontrol-replace-node-summing-with-memcg_page_state +++ a/mm/memcontrol.c @@ -746,10 +746,13 @@ static unsigned long mem_cgroup_nr_lru_p unsigned int lru_mask) { unsigned long nr = 0; - int nid; + enum lru_list lru; - for_each_node_state(nid, N_MEMORY) - nr += mem_cgroup_node_nr_lru_pages(memcg, nid, lru_mask); + for_each_lru(lru) { + if (!(BIT(lru) & lru_mask)) + continue; + nr += memcg_page_state(memcg, NR_LRU_BASE + lru); + } return nr; } _ Patches currently in -mm which might be from hannes@xxxxxxxxxxx are mm-memcontrol-track-lru-counts-in-the-vmstats-array.patch mm-memcontrol-replace-zone-summing-with-lruvec_page_state.patch mm-memcontrol-replace-node-summing-with-memcg_page_state.patch mm-memcontrol-push-down-mem_cgroup_node_nr_lru_pages.patch mm-memcontrol-push-down-mem_cgroup_nr_lru_pages.patch mm-memcontrol-quarantine-the-mem_cgroup_nr_lru_pages-api.patch