Skip to content

Commit f00230f

Browse files
yhuang-inteltorvalds
authored andcommitted
mm,do_huge_pmd_numa_page: remove unnecessary TLB flushing code
Before commit c5b5a3d ("mm: thp: refactor NUMA fault handling"), the TLB flushing is done in do_huge_pmd_numa_page() itself via flush_tlb_range(). But after commit c5b5a3d ("mm: thp: refactor NUMA fault handling"), the TLB flushing is done in migrate_pages() as in the following code path anyway. do_huge_pmd_numa_page migrate_misplaced_page migrate_pages So now, the TLB flushing code in do_huge_pmd_numa_page() becomes unnecessary. So the code is deleted in this patch to simplify the code. This is only code cleanup, there's no visible performance difference. The mmu_notifier_invalidate_range() in do_huge_pmd_numa_page() is deleted too. Because migrate_pages() takes care of that too when CPU TLB is flushed. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: "Huang, Ying" <[email protected]> Reviewed-by: Zi Yan <[email protected]> Reviewed-by: Yang Shi <[email protected]> Cc: Dan Carpenter <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Gerald Schaefer <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Paolo Bonzini <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent f358afc commit f00230f

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

mm/huge_memory.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,32 +1440,6 @@ vm_fault_t do_huge_pmd_numa_page(struct vm_fault *vmf)
14401440
goto out;
14411441
}
14421442

1443-
/*
1444-
* Since we took the NUMA fault, we must have observed the !accessible
1445-
* bit. Make sure all other CPUs agree with that, to avoid them
1446-
* modifying the page we're about to migrate.
1447-
*
1448-
* Must be done under PTL such that we'll observe the relevant
1449-
* inc_tlb_flush_pending().
1450-
*
1451-
* We are not sure a pending tlb flush here is for a huge page
1452-
* mapping or not. Hence use the tlb range variant
1453-
*/
1454-
if (mm_tlb_flush_pending(vma->vm_mm)) {
1455-
flush_tlb_range(vma, haddr, haddr + HPAGE_PMD_SIZE);
1456-
/*
1457-
* change_huge_pmd() released the pmd lock before
1458-
* invalidating the secondary MMUs sharing the primary
1459-
* MMU pagetables (with ->invalidate_range()). The
1460-
* mmu_notifier_invalidate_range_end() (which
1461-
* internally calls ->invalidate_range()) in
1462-
* change_pmd_range() will run after us, so we can't
1463-
* rely on it here and we need an explicit invalidate.
1464-
*/
1465-
mmu_notifier_invalidate_range(vma->vm_mm, haddr,
1466-
haddr + HPAGE_PMD_SIZE);
1467-
}
1468-
14691443
pmd = pmd_modify(oldpmd, vma->vm_page_prot);
14701444
page = vm_normal_page_pmd(vma, haddr, pmd);
14711445
if (!page)

0 commit comments

Comments
 (0)