svn commit: r188143 - user/dfr/xenhvm/6/sys/amd64/amd64
Doug Rabson
dfr at FreeBSD.org
Thu Feb 5 06:02:05 PST 2009
Author: dfr
Date: Thu Feb 5 14:02:04 2009
New Revision: 188143
URL: http://svn.freebsd.org/changeset/base/188143
Log:
Add some disabled code which calls the hypervisor to flush TLBs. Disabled
because it seems to be slower in my tests.
Modified:
user/dfr/xenhvm/6/sys/amd64/amd64/pmap.c
Modified: user/dfr/xenhvm/6/sys/amd64/amd64/pmap.c
==============================================================================
--- user/dfr/xenhvm/6/sys/amd64/amd64/pmap.c Thu Feb 5 11:48:10 2009 (r188142)
+++ user/dfr/xenhvm/6/sys/amd64/amd64/pmap.c Thu Feb 5 14:02:04 2009 (r188143)
@@ -144,6 +144,11 @@ __FBSDID("$FreeBSD$");
#ifdef SMP
#include <machine/smp.h>
#endif
+#ifdef XENHVM
+#include <machine/xen/xen-os.h>
+#include <xen/hypervisor.h>
+#include <xen/interface/hvm/hvm_op.h>
+#endif
#ifndef PMAP_SHPGPERPROC
#define PMAP_SHPGPERPROC 200
@@ -793,8 +798,20 @@ pmap_invalidate_all(pmap_t pmap)
sched_pin();
if (pmap == kernel_pmap || pmap->pm_active == all_cpus) {
- invltlb();
- smp_invltlb();
+#if defined(XENHVM) && defined(notdef)
+ /*
+ * As far as I can tell, this makes things slower, at
+ * least where there are only two physical cpus and
+ * the host is not overcommitted.
+ */
+ if (is_running_on_xen()) {
+ HYPERVISOR_hvm_op(HVMOP_flush_tlbs, NULL);
+ } else
+#endif
+ {
+ invltlb();
+ smp_invltlb();
+ }
} else {
cpumask = PCPU_GET(cpumask);
other_cpus = PCPU_GET(other_cpus);
More information about the svn-src-user
mailing list