[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <602d9624-1a41-611f-bba9-f38806be9c33@linux.alibaba.com>
Date: Wed, 15 Apr 2020 13:32:59 -0700
From: Yang Shi <yang.shi@...ux.alibaba.com>
To: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
akpm@...ux-foundation.org, Andrea Arcangeli <aarcange@...hat.com>
Cc: Zi Yan <ziy@...dia.com>, Ralph Campbell <rcampbell@...dia.com>,
John Hubbard <jhubbard@...dia.com>,
William Kucharski <william.kucharski@...cle.com>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCHv3, RESEND 4/8] khugepaged: Drain LRU add pagevec after
swapin
On 4/13/20 5:52 AM, Kirill A. Shutemov wrote:
> __collapse_huge_page_isolate() may fail due to extra pin in the LRU add
> pagevec. It's pretty common for swapin case: we swap in pages just to
> fail due to the extra pin.
>
> Drain LRU add pagevec on successful swapin.
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
> ---
> mm/khugepaged.c | 5 +++++
> 1 file changed, 5 insertions(+)
Acked-by: Yang Shi <yang.shi@...ux.alibaba.com>
>
> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> index ee66c140c2d6..e3e41c2768d8 100644
> --- a/mm/khugepaged.c
> +++ b/mm/khugepaged.c
> @@ -934,6 +934,11 @@ static bool __collapse_huge_page_swapin(struct mm_struct *mm,
> }
> vmf.pte--;
> pte_unmap(vmf.pte);
> +
> + /* Drain LRU add pagevec to remove extra pin on the swapped in pages */
> + if (swapped_in)
> + lru_add_drain();
> +
> trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 1);
> return true;
> }
Powered by blists - more mailing lists