diff mbox series

[v6,1/4] mm/khugepaged: drain lru after swapping in shmem

Message ID 20230404120117.2562166-2-stevensd@google.com (mailing list archive)
State New
Headers show
Series mm/khugepaged: fixes for khugepaged+shmem | expand

Commit Message

David Stevens April 4, 2023, 12:01 p.m. UTC
From: David Stevens <stevensd@chromium.org>

Call lru_add_drain after swapping in shmem pages so that
isolate_lru_page is more likely to succeed.

Signed-off-by: David Stevens <stevensd@chromium.org>
---
 mm/khugepaged.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 666d2c4e38dd..90577247cfaf 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -1963,6 +1963,8 @@  static int collapse_file(struct mm_struct *mm, unsigned long addr,
 					result = SCAN_FAIL;
 					goto xa_unlocked;
 				}
+				/* drain pagevecs to help isolate_lru_page() */
+				lru_add_drain();
 				page = folio_file_page(folio, index);
 			} else if (trylock_page(page)) {
 				get_page(page);