[RFC PATCH 6/6] alpha: shoot the lazy tlb mm when flushing TLBs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since we're flushing the TLB, take the opportunity to switch away from
a lazy tlb mm if it's active, allowing the CPU to be taken out of
mm_cpumask and avoiding any further IPIs from TLB flushing or the final
lazy tlb mm shootdown.

This naturally combines lazy tlb mm shootdowns with the final exit TLB
flush IPIs, reducing the need for additional IPIs for the lazy tlb mm
shootdown.

Signed-off-by: Nicholas Piggin <npiggin@xxxxxxxxx>
---
 arch/alpha/kernel/smp.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index 73bbb81f336e..cccd5ef721b7 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -624,9 +624,18 @@ try_clear_mm_cpumask(struct mm_struct *mm)
 {
 	int cpu;
 
-	if (current->active_mm == mm || asn_locked())
+	if (current->mm == mm || asn_locked())
 		return;
 
+	/*
+	 * Shoot the lazy tlb mm while we're here. This allows us to also
+	 * trim it out of the mm_cpumask if it was the active_mm, and has the
+	 * effect of avoiding final lazy shootdown IPIs in cleanup_lazy_tlbs(),
+	 * because the final TLB cleanup happens before that.
+	 */
+	if (current->active_mm == mm)
+		kthread_end_lazy_tlb_mm();
+
 	cpu = smp_processor_id();
 	if (cpumask_test_cpu(cpu, mm_cpumask(mm)))
 		cpumask_clear_cpu(cpu, mm_cpumask(mm));
-- 
2.40.1




[Index of Archives]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux