+ x86-tlb-flush-avoid-superflous-leave_mm.patch added to -mm tree

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

 



The patch titled
     Subject: x86: tlb flush avoid superflous leave_mm()
has been added to the -mm tree.  Its filename is
     x86-tlb-flush-avoid-superflous-leave_mm.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
From: Shaohua Li <shaohua.li@xxxxxxxxx>
Subject: x86: tlb flush avoid superflous leave_mm()

If just one page VA tlb is required to be flushed and current task is in
lazy TLB state, doing leave_mm() is superfluous because it flushes the
whole TLB.  This can reduce some TLB miss.

Signed-off-by: Shaohua Li <shaohua.li@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxx>
---

 arch/x86/mm/tlb.c |   16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff -puN arch/x86/mm/tlb.c~x86-tlb-flush-avoid-superflous-leave_mm arch/x86/mm/tlb.c
--- a/arch/x86/mm/tlb.c~x86-tlb-flush-avoid-superflous-leave_mm
+++ a/arch/x86/mm/tlb.c
@@ -155,13 +155,13 @@ void smp_invalidate_interrupt(struct pt_
 		 */
 
 	if (f->flush_mm == percpu_read(cpu_tlbstate.active_mm)) {
-		if (percpu_read(cpu_tlbstate.state) == TLBSTATE_OK) {
-			if (f->flush_va == TLB_FLUSH_ALL)
+		if (f->flush_va == TLB_FLUSH_ALL) {
+			if (percpu_read(cpu_tlbstate.state) == TLBSTATE_OK)
 				local_flush_tlb();
 			else
-				__flush_tlb_one(f->flush_va);
+				leave_mm(cpu);
 		} else
-			leave_mm(cpu);
+			__flush_tlb_one(f->flush_va);
 	}
 out:
 	ack_APIC_irq();
@@ -309,12 +309,8 @@ void flush_tlb_page(struct vm_area_struc
 
 	preempt_disable();
 
-	if (current->active_mm == mm) {
-		if (current->mm)
-			__flush_tlb_one(va);
-		else
-			leave_mm(smp_processor_id());
-	}
+	if (current->active_mm == mm)
+		__flush_tlb_one(va);
 
 	if (cpumask_any_but(mm_cpumask(mm), smp_processor_id()) < nr_cpu_ids)
 		flush_tlb_others(mm_cpumask(mm), mm, va);
_
Subject: Subject: x86: tlb flush avoid superflous leave_mm()

Patches currently in -mm which might be from shaohua.li@xxxxxxxxx are

origin.patch
linux-next.patch
x86-tlb-flush-avoid-superflous-leave_mm.patch
vmscan-add-block-plug-for-page-reclaim.patch
vmscan-count-pages-into-balanced-for-zone-with-good-watermark.patch
vmscan-promote-shared-file-mapped-pages.patch
vmscan-activate-executable-pages-after-first-usage.patch
intel_idle-fix-api-misuse.patch
intel_idle-disable-auto_demotion-for-hotplugged-cpus.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux