The patch titled Subject: mm-vmscan-detect-file-thrashing-at-the-reclaim-root-fix has been added to the -mm tree. Its filename is mm-vmscan-detect-file-thrashing-at-the-reclaim-root-fix.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-vmscan-detect-file-thrashing-at-the-reclaim-root-fix.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-vmscan-detect-file-thrashing-at-the-reclaim-root-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-vmscan-detect-file-thrashing-at-the-reclaim-root-fix Shakeel points out that the page is locked and already charged by the time we call workingset_refault(). Instead of doing another cgroup lookup and reference from current->mm we can simply use page_memcg(). Link: http://lkml.kernel.org/r/20191115160722.GA309754@xxxxxxxxxxx Signed-off-by: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Suren Baghdasaryan <surenb@xxxxxxxxxx> Cc: Shakeel Butt <shakeelb@xxxxxxxxxx> Cc: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx> Cc: Rik van Riel <riel@xxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/workingset.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) --- a/mm/workingset.c~mm-vmscan-detect-file-thrashing-at-the-reclaim-root-fix +++ a/mm/workingset.c @@ -338,7 +338,7 @@ void workingset_refault(struct page *pag * However, the cgroup that will own the page is the one that * is actually experiencing the refault event. */ - memcg = get_mem_cgroup_from_mm(current->mm); + memcg = page_memcg(page); lruvec = mem_cgroup_lruvec(memcg, pgdat); inc_lruvec_state(lruvec, WORKINGSET_REFAULT); @@ -349,7 +349,7 @@ void workingset_refault(struct page *pag * the memory was available to the page cache. */ if (refault_distance > active_file) - goto out_memcg; + goto out; SetPageActive(page); advance_inactive_age(memcg, pgdat); @@ -360,9 +360,6 @@ void workingset_refault(struct page *pag SetPageWorkingset(page); inc_lruvec_state(lruvec, WORKINGSET_RESTORE); } - -out_memcg: - mem_cgroup_put(memcg); out: rcu_read_unlock(); } _ Patches currently in -mm which might be from hannes@xxxxxxxxxxx are mm-memcontrol-remove-dead-code-from-memory_max_write.patch mm-memcontrol-try-harder-to-set-a-new-memoryhigh.patch mm-drop-mmap_sem-before-calling-balance_dirty_pages-in-write-fault.patch mm-vmscan-simplify-lruvec_lru_size.patch mm-clean-up-and-clarify-lruvec-lookup-procedure.patch mm-vmscan-move-inactive_list_is_low-swap-check-to-the-caller.patch mm-vmscan-naming-fixes-global_reclaim-and-sane_reclaim.patch mm-vmscan-replace-shrink_node-loop-with-a-retry-jump.patch mm-vmscan-turn-shrink_node_memcg-into-shrink_lruvec.patch mm-vmscan-split-shrink_node-into-node-part-and-memcgs-part.patch mm-vmscan-split-shrink_node-into-node-part-and-memcgs-part-fix.patch mm-vmscan-harmonize-writeback-congestion-tracking-for-nodes-memcgs.patch mm-vmscan-move-file-exhaustion-detection-to-the-node-level.patch mm-vmscan-detect-file-thrashing-at-the-reclaim-root.patch mm-vmscan-enforce-inactive-active-ratio-at-the-reclaim-root.patch mm-vmscan-detect-file-thrashing-at-the-reclaim-root-fix.patch kernel-sysctl-make-drop_caches-write-only.patch