|
@@ -1599,7 +1599,8 @@ int numamigrate_isolate_page(pg_data_t *pgdat, struct page *page)
|
|
|
* node. Caller is expected to have an elevated reference count on
|
|
|
* the page that will be dropped by this function before returning.
|
|
|
*/
|
|
|
-int migrate_misplaced_page(struct page *page, int node)
|
|
|
+int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma,
|
|
|
+ int node)
|
|
|
{
|
|
|
pg_data_t *pgdat = NODE_DATA(node);
|
|
|
int isolated;
|
|
@@ -1607,10 +1608,11 @@ int migrate_misplaced_page(struct page *page, int node)
|
|
|
LIST_HEAD(migratepages);
|
|
|
|
|
|
/*
|
|
|
- * Don't migrate pages that are mapped in multiple processes.
|
|
|
- * TODO: Handle false sharing detection instead of this hammer
|
|
|
+ * 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)
|
|
|
+ if (page_mapcount(page) != 1 && page_is_file_cache(page) &&
|
|
|
+ (vma->vm_flags & VM_EXEC))
|
|
|
goto out;
|
|
|
|
|
|
/*
|
|
@@ -1660,13 +1662,6 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm,
|
|
|
struct mem_cgroup *memcg = NULL;
|
|
|
int page_lru = page_is_file_cache(page);
|
|
|
|
|
|
- /*
|
|
|
- * Don't migrate pages that are mapped in multiple processes.
|
|
|
- * TODO: Handle false sharing detection instead of this hammer
|
|
|
- */
|
|
|
- if (page_mapcount(page) != 1)
|
|
|
- goto out_dropref;
|
|
|
-
|
|
|
/*
|
|
|
* Rate-limit the amount of data that is being migrated to a node.
|
|
|
* Optimal placement is no good if the memory bus is saturated and
|