summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/cpufunc.h
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1997-12-14 02:11:23 +0000
committerdyson <dyson@FreeBSD.org>1997-12-14 02:11:23 +0000
commit738872cad6b501578d2839e485ca5a73de1bcee5 (patch)
tree03005c15fc08329aab24f55b693fb72f704b6dee /sys/i386/include/cpufunc.h
parentacf3f6c34674e4d5895a65c2500aa558ceeac52a (diff)
downloadFreeBSD-src-738872cad6b501578d2839e485ca5a73de1bcee5.zip
FreeBSD-src-738872cad6b501578d2839e485ca5a73de1bcee5.tar.gz
After one of my analysis passes to evaluate methods for SMP TLB mgmt, I
noticed some major enhancements available for UP situations. The number of UP TLB flushes is decreased much more than significantly with these changes. Since a TLB flush appears to cost minimally approx 80 cycles, this is a "nice" enhancement, equiv to eliminating between 40 and 160 instructions per TLB flush. Changes include making sure that kernel threads all use the same PTD, and eliminate unneeded PTD switches at context switch time.
Diffstat (limited to 'sys/i386/include/cpufunc.h')
-rw-r--r--sys/i386/include/cpufunc.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index 3b7eb9c..4143dce 100644
--- a/sys/i386/include/cpufunc.h
+++ b/sys/i386/include/cpufunc.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cpufunc.h,v 1.3 1997/09/05 20:20:31 smp Exp smp $
+ * $Id: cpufunc.h,v 1.72 1997/09/07 22:01:27 fsmp Exp $
*/
/*
@@ -45,6 +45,9 @@
#include <machine/lock.h>
+#if defined(SWTCH_OPTIM_STATS)
+extern int tlb_flush_count;
+#endif
#ifdef __GNUC__
@@ -234,6 +237,9 @@ invltlb(void)
*/
__asm __volatile("movl %%cr3, %0; movl %0, %%cr3" : "=r" (temp)
: : "memory");
+#if defined(SWTCH_OPTIM_STATS)
+ ++tlb_flush_count;
+#endif
}
#endif /* SMP */
OpenPOWER on IntegriCloud