From: Feng Tang <feng.tang(a)intel.com>
ANBZ: #80
cherry-picked from
https://git.kernel.org/pub/scm/linux/kernel/git/vishal/tiering.git/commit/?…
Now, migrate_misplaced_page() can be used for the mapped pages only.
We want to use it for the unmapped file cache pages in the following
patches. So the "VMA" parameter (not available for the unmapped
pages) checking in the function is loosed.
Signed-off-by: Feng Tang <feng.tang(a)intel.com>
Signed-off-by: Baolin Wang <baolin.wang(a)linux.alibaba.com>
---
mm/migrate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/migrate.c b/mm/migrate.c
index f263a4a..15838b3 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -2029,7 +2029,7 @@ int migrate_misplaced_page(struct page *page, struct vm_area_struct
*vma,
* Don't migrate file pages that are mapped in multiple processes
* with execute permissions as they are probably shared libraries.
*/
- if (page_mapcount(page) != 1 && page_is_file_cache(page) &&
+ if (vma && page_mapcount(page) != 1 && page_is_file_cache(page)
&&
(vma->vm_flags & VM_EXEC))
goto out;
--
1.8.3.1