Skip to content

Commit b0943d6

Browse files
Mel Gormantorvalds
authored andcommitted
mm: numa: defer TLB flush for THP migration as long as possible
THP migration can fail for a variety of reasons. Avoid flushing the TLB to deal with THP migration races until the copy is ready to start. Signed-off-by: Mel Gorman <mgorman@suse.de> Reviewed-by: Rik van Riel <riel@redhat.com> Cc: Alex Thorlton <athorlton@sgi.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent af2c140 commit b0943d6

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

mm/huge_memory.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,13 +1376,6 @@ int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
13761376
goto clear_pmdnuma;
13771377
}
13781378

1379-
/*
1380-
* The page_table_lock above provides a memory barrier
1381-
* with change_protection_range.
1382-
*/
1383-
if (mm_tlb_flush_pending(mm))
1384-
flush_tlb_range(vma, haddr, haddr + HPAGE_PMD_SIZE);
1385-
13861379
/*
13871380
* Migrate the THP to the requested node, returns with page unlocked
13881381
* and pmd_numa cleared.

mm/migrate.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,6 +1759,9 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm,
17591759
goto out_fail;
17601760
}
17611761

1762+
if (mm_tlb_flush_pending(mm))
1763+
flush_tlb_range(vma, mmun_start, mmun_end);
1764+
17621765
/* Prepare a page as a migration target */
17631766
__set_page_locked(new_page);
17641767
SetPageSwapBacked(new_page);

0 commit comments

Comments
 (0)