aboutsummaryrefslogtreecommitdiffstats
path: root/mm/migrate.c
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2014-06-04 19:07:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 19:54:01 -0400
commit11de9927f9dd3cb0a0f18064fa4b6976fc37e79c (patch)
treeda8bdfb5203cdde353b213411dab97ac4216ba92 /mm/migrate.c
parentbd67314586a3d5725e60f2f6587b4cb0f659bb67 (diff)
mm: numa: add migrated transhuge pages to LRU the same way as base pages
Migration of misplaced transhuge pages uses page_add_new_anon_rmap() when putting the page back as it avoided an atomic operations and added the new page to the correct LRU. A side-effect is that the page gets marked activated as part of the migration meaning that transhuge and base pages are treated differently from an aging perspective than base page migration. This patch uses page_add_anon_rmap() and putback_lru_page() on completion of a transhuge migration similar to base page migration. It would require fewer atomic operations to use lru_cache_add without taking an additional reference to the page. The downside would be that it's still different to base page migration and unevictable pages may be added to the wrong LRU for cleaning up later. Testing of the usual workloads did not show any adverse impact to the change. Signed-off-by: Mel Gorman <mgorman@suse.de> Cc: Rik van Riel <riel@redhat.com> Cc: Sasha Levin <sasha.levin@oracle.com> Acked-by: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/migrate.c')
-rw-r--r--mm/migrate.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index bed48809e5d0..6247be7fa30e 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1852,7 +1852,7 @@ fail_putback:
1852 * guarantee the copy is visible before the pagetable update. 1852 * guarantee the copy is visible before the pagetable update.
1853 */ 1853 */
1854 flush_cache_range(vma, mmun_start, mmun_end); 1854 flush_cache_range(vma, mmun_start, mmun_end);
1855 page_add_new_anon_rmap(new_page, vma, mmun_start); 1855 page_add_anon_rmap(new_page, vma, mmun_start);
1856 pmdp_clear_flush(vma, mmun_start, pmd); 1856 pmdp_clear_flush(vma, mmun_start, pmd);
1857 set_pmd_at(mm, mmun_start, pmd, entry); 1857 set_pmd_at(mm, mmun_start, pmd, entry);
1858 flush_tlb_range(vma, mmun_start, mmun_end); 1858 flush_tlb_range(vma, mmun_start, mmun_end);
@@ -1877,6 +1877,10 @@ fail_putback:
1877 spin_unlock(ptl); 1877 spin_unlock(ptl);
1878 mmu_notifier_invalidate_range_end(mm, mmun_start, mmun_end); 1878 mmu_notifier_invalidate_range_end(mm, mmun_start, mmun_end);
1879 1879
1880 /* Take an "isolate" reference and put new page on the LRU. */
1881 get_page(new_page);
1882 putback_lru_page(new_page);
1883
1880 unlock_page(new_page); 1884 unlock_page(new_page);
1881 unlock_page(page); 1885 unlock_page(page);
1882 put_page(page); /* Drop the rmap reference */ 1886 put_page(page); /* Drop the rmap reference */