lkml.org 
[lkml]   [2021]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mm, compaction: avoid isolating pinned tmpfs pages
Date
This makes pinned tmpfs pages bail out early in the process of page
migration, like what pinned anonymous pages do.

Signed-off-by: Xu Yu <xuyu@linux.alibaba.com>
---
mm/compaction.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index e04f4476e68e..78c3b992a1c9 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -964,11 +964,11 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
}

/*
- * Migration will fail if an anonymous page is pinned in memory,
- * so avoid taking lru_lock and isolating it unnecessarily in an
- * admittedly racy check.
+ * Migration will fail if an anonymous or tmpfs page is pinned
+ * in memory, so avoid taking lru_lock and isolating it
+ * unnecessarily in an admittedly racy check.
*/
- if (!page_mapping(page) &&
+ if (!page_is_file_lru(page) &&
page_count(page) > page_mapcount(page))
goto isolate_fail;

--
2.20.1.2432.ga663e714
\
 
 \ /
  Last update: 2021-04-28 16:01    [W:1.865 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site