diff options
author | Mel Gorman <mgorman@suse.de> | 2013-10-07 06:29:05 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-10-09 06:40:32 -0400 |
commit | 1bc115d87dffd1c43bdc3c9c9d1e3a51c195d18e (patch) | |
tree | 56a26b4f4fe089e3dd1df5a26877d1e4c0114d35 /mm/migrate.c | |
parent | 9ff1d9ff3c2c8ab3feaeb2e8056a07ca293f7bde (diff) |
mm: numa: Scan pages with elevated page_mapcount
Currently automatic NUMA balancing is unable to distinguish between false
shared versus private pages except by ignoring pages with an elevated
page_mapcount entirely. This avoids shared pages bouncing between the
nodes whose task is using them but that is ignored quite a lot of data.
This patch kicks away the training wheels in preparation for adding support
for identifying shared/private pages is now in place. The ordering is so
that the impact of the shared/private detection can be easily measured. Note
that the patch does not migrate shared, file-backed within vmas marked
VM_EXEC as these are generally shared library pages. Migrating such pages
is not beneficial as there is an expectation they are read-shared between
caches and iTLB and iCache pressure is generally low.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1381141781-10992-28-git-send-email-mgorman@suse.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'mm/migrate.c')
-rw-r--r-- | mm/migrate.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index 7bd90d3b16bb..fcba2f46bb80 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -1599,7 +1599,8 @@ int numamigrate_isolate_page(pg_data_t *pgdat, struct page *page) | |||
1599 | * node. Caller is expected to have an elevated reference count on | 1599 | * node. Caller is expected to have an elevated reference count on |
1600 | * the page that will be dropped by this function before returning. | 1600 | * the page that will be dropped by this function before returning. |
1601 | */ | 1601 | */ |
1602 | int migrate_misplaced_page(struct page *page, int node) | 1602 | int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma, |
1603 | int node) | ||
1603 | { | 1604 | { |
1604 | pg_data_t *pgdat = NODE_DATA(node); | 1605 | pg_data_t *pgdat = NODE_DATA(node); |
1605 | int isolated; | 1606 | int isolated; |
@@ -1607,10 +1608,11 @@ int migrate_misplaced_page(struct page *page, int node) | |||
1607 | LIST_HEAD(migratepages); | 1608 | LIST_HEAD(migratepages); |
1608 | 1609 | ||
1609 | /* | 1610 | /* |
1610 | * Don't migrate pages that are mapped in multiple processes. | 1611 | * Don't migrate file pages that are mapped in multiple processes |
1611 | * TODO: Handle false sharing detection instead of this hammer | 1612 | * with execute permissions as they are probably shared libraries. |
1612 | */ | 1613 | */ |
1613 | if (page_mapcount(page) != 1) | 1614 | if (page_mapcount(page) != 1 && page_is_file_cache(page) && |
1615 | (vma->vm_flags & VM_EXEC)) | ||
1614 | goto out; | 1616 | goto out; |
1615 | 1617 | ||
1616 | /* | 1618 | /* |
@@ -1661,13 +1663,6 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm, | |||
1661 | int page_lru = page_is_file_cache(page); | 1663 | int page_lru = page_is_file_cache(page); |
1662 | 1664 | ||
1663 | /* | 1665 | /* |
1664 | * Don't migrate pages that are mapped in multiple processes. | ||
1665 | * TODO: Handle false sharing detection instead of this hammer | ||
1666 | */ | ||
1667 | if (page_mapcount(page) != 1) | ||
1668 | goto out_dropref; | ||
1669 | |||
1670 | /* | ||
1671 | * Rate-limit the amount of data that is being migrated to a node. | 1666 | * Rate-limit the amount of data that is being migrated to a node. |
1672 | * Optimal placement is no good if the memory bus is saturated and | 1667 | * Optimal placement is no good if the memory bus is saturated and |
1673 | * all the time is being spent migrating! | 1668 | * all the time is being spent migrating! |