aboutsummaryrefslogtreecommitdiffstats
path: root/mm/rmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/rmap.c')
-rw-r--r--mm/rmap.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/mm/rmap.c b/mm/rmap.c
index c399a0d41b31..307b555024ef 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -569,19 +569,6 @@ void page_unlock_anon_vma_read(struct anon_vma *anon_vma)
569} 569}
570 570
571#ifdef CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH 571#ifdef CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
572static void percpu_flush_tlb_batch_pages(void *data)
573{
574 /*
575 * All TLB entries are flushed on the assumption that it is
576 * cheaper to flush all TLBs and let them be refilled than
577 * flushing individual PFNs. Note that we do not track mm's
578 * to flush as that might simply be multiple full TLB flushes
579 * for no gain.
580 */
581 count_vm_tlb_event(NR_TLB_REMOTE_FLUSH_RECEIVED);
582 flush_tlb_local();
583}
584
585/* 572/*
586 * Flush TLB entries for recently unmapped pages from remote CPUs. It is 573 * Flush TLB entries for recently unmapped pages from remote CPUs. It is
587 * important if a PTE was dirty when it was unmapped that it's flushed 574 * important if a PTE was dirty when it was unmapped that it's flushed
@@ -598,15 +585,14 @@ void try_to_unmap_flush(void)
598 585
599 cpu = get_cpu(); 586 cpu = get_cpu();
600 587
601 trace_tlb_flush(TLB_REMOTE_SHOOTDOWN, -1UL); 588 if (cpumask_test_cpu(cpu, &tlb_ubc->cpumask)) {
602 589 count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL);
603 if (cpumask_test_cpu(cpu, &tlb_ubc->cpumask)) 590 local_flush_tlb();
604 percpu_flush_tlb_batch_pages(&tlb_ubc->cpumask); 591 trace_tlb_flush(TLB_LOCAL_SHOOTDOWN, TLB_FLUSH_ALL);
605
606 if (cpumask_any_but(&tlb_ubc->cpumask, cpu) < nr_cpu_ids) {
607 smp_call_function_many(&tlb_ubc->cpumask,
608 percpu_flush_tlb_batch_pages, (void *)tlb_ubc, true);
609 } 592 }
593
594 if (cpumask_any_but(&tlb_ubc->cpumask, cpu) < nr_cpu_ids)
595 flush_tlb_others(&tlb_ubc->cpumask, NULL, 0, TLB_FLUSH_ALL);
610 cpumask_clear(&tlb_ubc->cpumask); 596 cpumask_clear(&tlb_ubc->cpumask);
611 tlb_ubc->flush_required = false; 597 tlb_ubc->flush_required = false;
612 tlb_ubc->writable = false; 598 tlb_ubc->writable = false;
@@ -1555,7 +1541,7 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
1555 1541
1556discard: 1542discard:
1557 page_remove_rmap(page, PageHuge(page)); 1543 page_remove_rmap(page, PageHuge(page));
1558 page_cache_release(page); 1544 put_page(page);
1559 1545
1560out_unmap: 1546out_unmap:
1561 pte_unmap_unlock(pte, ptl); 1547 pte_unmap_unlock(pte, ptl);