From: Suresh Siddha Date: Fri, 23 Mar 2012 00:01:25 +0000 (-0700) Subject: x86, tlb: Switch cr3 in leave_mm() only when needed X-Git-Tag: v3.5-rc1~124^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6fca40f1d7f3e232c9de27c1cebbb9f787fbc4f;p=pandora-kernel.git x86, tlb: Switch cr3 in leave_mm() only when needed Currently leave_mm() unconditionally switches the cr3 to swapper_pg_dir. But there is no need to change the cr3, if we already left that mm. intel_idle() for example calls leave_mm() on every deep c-state entry where the CPU flushes the TLB for us. Similarly flush_tlb_all() was also calling leave_mm() whenever the TLB is in LAZY state. Both these paths will be improved with this change. Signed-off-by: Suresh Siddha Link: http://lkml.kernel.org/r/1332460885.16101.147.camel@sbsiddha-desk.sc.intel.com Signed-off-by: H. Peter Anvin --- Reading git-diff-tree failed