The patch titled Subject: mm: workingset: don't drop refault information prematurely fix has been added to the -mm tree. Its filename is mm-workingset-dont-drop-refault-information-prematurely-fix.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-workingset-dont-drop-refault-information-prematurely-fix.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-workingset-dont-drop-refault-information-prematurely-fix.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: workingset: don't drop refault information prematurely fix The shadow shrinker is invoked per NUMA node, but the shadow limit enforced for cgroups is based on the page counter, which isn't NUMA aware. Instead of shrinking shadow pages to desired_size, we end up with desired_size * nr_online_nodes. Switch to NUMA-aware lru and slab counters to approximate cgroup size. Link: http://lkml.kernel.org/r/20181009184732.762-2-hannes@xxxxxxxxxxx Signed-off-by: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Daniel Drake <drake@xxxxxxxxxxxx> Cc: Suren Baghdasaryan <surenb@xxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Cc: Tejun Heo <tj@xxxxxxxxxx> Cc: Vinayak Menon <vinmenon@xxxxxxxxxxxxxx> Cc: Christopher Lameter <cl@xxxxxxxxx> Cc: Peter Enderborg <peter.enderborg@xxxxxxxx> Cc: Shakeel Butt <shakeelb@xxxxxxxxxx> Cc: Mike Galbraith <efault@xxxxxx> Cc: Randy Dunlap <rdunlap@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/workingset.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) --- a/mm/workingset.c~mm-workingset-dont-drop-refault-information-prematurely-fix +++ a/mm/workingset.c @@ -391,9 +391,15 @@ static unsigned long count_shadow_nodes( * PAGE_SIZE / radix_tree_nodes / node_entries * 8 / PAGE_SIZE */ #ifdef CONFIG_MEMCG - if (sc->memcg) - pages = page_counter_read(&sc->memcg->memory); - else + if (sc->memcg) { + struct lruvec *lruvec; + + pages = mem_cgroup_node_nr_lru_pages(sc->memcg, sc->nid, + LRU_ALL); + lruvec = mem_cgroup_lruvec(NODE_DATA(sc->nid), sc->memcg); + pages += lruvec_page_state(lruvec, NR_SLAB_RECLAIMABLE); + pages += lruvec_page_state(lruvec, NR_SLAB_UNRECLAIMABLE); + } else #endif pages = node_present_pages(sc->nid); _ Patches currently in -mm which might be from hannes@xxxxxxxxxxx are mm-workingset-dont-drop-refault-information-prematurely-fix.patch mm-workingset-tell-cache-transitions-from-workingset-thrashing.patch delayacct-track-delays-from-thrashing-cache-pages.patch sched-loadavg-consolidate-load_int-load_frac-calc_load.patch sched-loadavg-consolidate-load_int-load_frac-calc_load-fix-fix.patch sched-loadavg-make-calc_load_n-public.patch sched-schedh-make-rq-locking-and-clock-functions-available-in-statsh.patch sched-introduce-this_rq_lock_irq.patch psi-pressure-stall-information-for-cpu-memory-and-io.patch psi-pressure-stall-information-for-cpu-memory-and-io-fix.patch psi-pressure-stall-information-for-cpu-memory-and-io-fix-2.patch psi-pressure-stall-information-for-cpu-memory-and-io-fix-3.patch psi-pressure-stall-information-for-cpu-memory-and-io-fix-4.patch psi-cgroup-support.patch