[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200417145909.476o5ppho5p3cgyk@box>
Date: Fri, 17 Apr 2020 17:59:09 +0300
From: "Kirill A. Shutemov" <kirill@...temov.name>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Zi Yan <ziy@...dia.com>, Yang Shi <yang.shi@...ux.alibaba.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: [PATCHv4 4/8] khugepaged: Drain LRU add pagevec after swapin
On Thu, Apr 16, 2020 at 09:41:45PM -0700, Andrew Morton wrote:
> On Thu, 16 Apr 2020 19:00:22 +0300 "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com> 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.
>
> I don't see how this patch can do anything to prevent
> __collapse_huge_page_isolate() from failing, which is what the
> changelog implies.
>
> Can we have a more detailed changelog, please?
What about something like this:
khugepaged: Drain LRU add pagevec after swapin
collapse_huge_page() tries to swap in pages that are part of the PMD
range. Just swapped in page goes though LRU add cache. The cache gets
extra reference on the page.
The extra reference can lead to the collapse fail: the following
__collapse_huge_page_isolate() would check refcount and abort collapse
seeing unexpected refcount.
The fix is to drain local LRU add cache in __collapse_huge_page_swapin()
if we successfully swapped in any pages.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
Reviewed-by: William Kucharski <william.kucharski@...cle.com>
Reviewed-and-Tested-by: Zi Yan <ziy@...dia.com>
Acked-by: Yang Shi <yang.shi@...ux.alibaba.com>
--
Kirill A. Shutemov
Powered by blists - more mailing lists