[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200416160026.16538-4-kirill.shutemov@linux.intel.com>
Date: Thu, 16 Apr 2020 19:00:21 +0300
From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To: akpm@...ux-foundation.org, Andrea Arcangeli <aarcange@...hat.com>
Cc: 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,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Subject: [PATCHv4 3/8] khugepaged: Drain all LRU caches before scanning pages
Having a page in LRU add cache offsets page refcount and gives
false-negative on PageLRU(). It reduces collapse success rate.
Drain all LRU add caches before scanning. It happens relatively
rare and should not disturb the system too much.
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>
---
mm/khugepaged.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 6e69dc9a9fb1..0b75b9821f44 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -2078,6 +2078,8 @@ static void khugepaged_do_scan(void)
barrier(); /* write khugepaged_pages_to_scan to local stack */
+ lru_add_drain_all();
+
while (progress < pages) {
if (!khugepaged_prealloc_page(&hpage, &wait))
break;
--
2.26.1
Powered by blists - more mailing lists