lkml.org 
[lkml]   [2020]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v21 11/19] mm/vmscan: remove lruvec reget in move_pages_to_lru
    Date
    Isolated page shouldn't be recharged by memcg since the memcg
    migration isn't possible at the time. All pages were isolated
    from the same lruvec (and isolation inhibits memcg migration).
    So remove unnecessary regetting.

    Thanks to Alexander Duyck for pointing this out.

    Signed-off-by: Alex Shi <alex.shi@linux.alibaba.com>
    Acked-by: Hugh Dickins <hughd@google.com>
    Acked-by: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
    Cc: Michal Hocko <mhocko@kernel.org>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: linux-mm@kvack.org
    Cc: linux-kernel@vger.kernel.org
    Cc: cgroups@vger.kernel.org
    ---
    mm/vmscan.c | 7 ++++++-
    1 file changed, 6 insertions(+), 1 deletion(-)

    diff --git a/mm/vmscan.c b/mm/vmscan.c
    index d771f812e983..cb2f6256a7d6 100644
    --- a/mm/vmscan.c
    +++ b/mm/vmscan.c
    @@ -1887,7 +1887,12 @@ static unsigned noinline_for_stack move_pages_to_lru(struct lruvec *lruvec,
    continue;
    }

    - lruvec = mem_cgroup_page_lruvec(page, pgdat);
    + /*
    + * All pages were isolated from the same lruvec (and isolation
    + * inhibits memcg migration).
    + */
    + VM_BUG_ON_PAGE(mem_cgroup_page_lruvec(page, page_pgdat(page))
    + != lruvec, page);
    lru = page_lru(page);
    nr_pages = thp_nr_pages(page);

    --
    1.8.3.1
    \
     
     \ /
      Last update: 2020-11-05 09:57    [W:2.575 / U:0.312 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site