The patch titled Subject: mm: move nr_deactivate accounting to shrink_active_list() has been added to the -mm tree. Its filename is mm-move-nr_deactivate-accounting-to-shrink_active_list.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-move-nr_deactivate-accounting-to-shrink_active_list.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-move-nr_deactivate-accounting-to-shrink_active_list.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: Kirill Tkhai <ktkhai@xxxxxxxxxxxxx> Subject: mm: move nr_deactivate accounting to shrink_active_list() We know which LRU is not active. Link: http://lkml.kernel.org/r/155290128498.31489.18250485448913338607.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai <ktkhai@xxxxxxxxxxxxx> Reviewed-by: Daniel Jordan <daniel.m.jordan@xxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/vmscan.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) --- a/mm/vmscan.c~mm-move-nr_deactivate-accounting-to-shrink_active_list +++ a/mm/vmscan.c @@ -2040,12 +2040,6 @@ static unsigned move_active_pages_to_lru } } - if (!is_active_lru(lru)) { - __count_vm_events(PGDEACTIVATE, nr_moved); - count_memcg_events(lruvec_memcg(lruvec), PGDEACTIVATE, - nr_moved); - } - return nr_moved; } @@ -2137,6 +2131,10 @@ static void shrink_active_list(unsigned nr_activate = move_active_pages_to_lru(lruvec, &l_active, &l_hold, lru); nr_deactivate = move_active_pages_to_lru(lruvec, &l_inactive, &l_hold, lru - LRU_ACTIVE); + + __count_vm_events(PGDEACTIVATE, nr_deactivate); + __count_memcg_events(lruvec_memcg(lruvec), PGDEACTIVATE, nr_deactivate); + __mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, -nr_taken); spin_unlock_irq(&pgdat->lru_lock); _ Patches currently in -mm which might be from ktkhai@xxxxxxxxxxxxx are mm-move-recent_rotated-pages-calculation-to-shrink_inactive_list.patch mm-move-nr_deactivate-accounting-to-shrink_active_list.patch mm-remove-pages_to_free-argument-of-move_active_pages_to_lru.patch mm-generalize-putback-scan-functions.patch