summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-06-27 22:39:14 +0000
committerpeter <peter@FreeBSD.org>2003-06-27 22:39:14 +0000
commit6df8dff079da162cd074e7e158f9132366f08c00 (patch)
tree64c053408cdbfcf347889812bb9208082ada0b18 /sys/i386
parent4abd2e77076d2c44c7c5bf99ba0845275e97a513 (diff)
downloadFreeBSD-src-6df8dff079da162cd074e7e158f9132366f08c00.zip
FreeBSD-src-6df8dff079da162cd074e7e158f9132366f08c00.tar.gz
Tidy up leftover lazy_switch instrumentation that is no longer needed.
This cleans up some #ifdef hell.
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/machdep.c38
-rw-r--r--sys/i386/i386/pmap.c34
-rw-r--r--sys/i386/i386/swtch.s30
-rw-r--r--sys/i386/include/md_var.h16
4 files changed, 2 insertions, 116 deletions
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index e89d297e..0719362 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$");
#include "opt_msgbuf.h"
#include "opt_npx.h"
#include "opt_perfmon.h"
-#include "opt_swtch.h"
#include "opt_kstack_pages.h"
#include <sys/param.h>
@@ -153,43 +152,6 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL)
int _udatasel, _ucodesel;
u_int atdevbase;
-#if defined(SWTCH_OPTIM_STATS)
-int stupid_switch;
-SYSCTL_INT(_debug, OID_AUTO, stupid_switch,
- CTLFLAG_RW, &stupid_switch, 0, "");
-int swtch_optim_stats;
-SYSCTL_INT(_debug, OID_AUTO, swtch_optim_stats,
- CTLFLAG_RW, &swtch_optim_stats, 0, "");
-int tlb_flush_count;
-SYSCTL_INT(_debug, OID_AUTO, tlb_flush_count,
- CTLFLAG_RW, &tlb_flush_count, 0, "");
-int lazy_flush_count;
-SYSCTL_INT(_debug, OID_AUTO, lazy_flush_count,
- CTLFLAG_RW, &lazy_flush_count, 0, "");
-int lazy_flush_fixup;
-SYSCTL_INT(_debug, OID_AUTO, lazy_flush_fixup,
- CTLFLAG_RW, &lazy_flush_fixup, 0, "");
-#ifdef SMP
-int lazy_flush_smpfixup;
-SYSCTL_INT(_debug, OID_AUTO, lazy_flush_smpfixup,
- CTLFLAG_RW, &lazy_flush_smpfixup, 0, "");
-int lazy_flush_smpipi;
-SYSCTL_INT(_debug, OID_AUTO, lazy_flush_smpipi,
- CTLFLAG_RW, &lazy_flush_smpipi, 0, "");
-int lazy_flush_smpbadcr3;
-SYSCTL_INT(_debug, OID_AUTO, lazy_flush_smpbadcr3,
- CTLFLAG_RW, &lazy_flush_smpbadcr3, 0, "");
-int lazy_flush_smpmiss;
-SYSCTL_INT(_debug, OID_AUTO, lazy_flush_smpmiss,
- CTLFLAG_RW, &lazy_flush_smpmiss, 0, "");
-#endif
-#endif
-#ifdef LAZY_SWITCH
-int lazy_flush_enable = 1;
-SYSCTL_INT(_debug, OID_AUTO, lazy_flush_enable,
- CTLFLAG_RW, &lazy_flush_enable, 0, "");
-#endif
-
int cold = 1;
#ifdef COMPAT_43
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index 1e45a97..573cffd 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -738,9 +738,6 @@ pmap_invalidate_all(pmap_t pmap)
u_int cpumask;
u_int other_cpus;
-#ifdef SWTCH_OPTIM_STATS
- tlb_flush_count++;
-#endif
critical_enter();
/*
* We need to disable interrupt preemption but MUST NOT have
@@ -1307,17 +1304,8 @@ pmap_lazyfix_action(void)
{
u_int mymask = PCPU_GET(cpumask);
- if (rcr3() == lazyptd) {
+ if (rcr3() == lazyptd)
load_cr3(PCPU_GET(curpcb)->pcb_cr3);
-#ifdef SWTCH_OPTIM_STATS
- atomic_add_int(&lazy_flush_smpfixup, 1);
- } else {
- if (*lazymask & mymask)
- lazy_flush_smpbadcr3++;
- else
- lazy_flush_smpmiss++;
-#endif
- }
atomic_clear_int(lazymask, mymask);
atomic_store_rel_int(&lazywait, 1);
}
@@ -1326,17 +1314,8 @@ static void
pmap_lazyfix_self(u_int mymask)
{
- if (rcr3() == lazyptd) {
+ if (rcr3() == lazyptd)
load_cr3(PCPU_GET(curpcb)->pcb_cr3);
-#ifdef SWTCH_OPTIM_STATS
- lazy_flush_fixup++;
- } else {
- if (*lazymask & mymask)
- lazy_flush_smpbadcr3++;
- else
- lazy_flush_smpmiss++;
-#endif
- }
atomic_clear_int(lazymask, mymask);
}
@@ -1370,9 +1349,6 @@ pmap_lazyfix(pmap_t pmap)
if (--spins == 0)
break;
}
-#ifdef SWTCH_OPTIM_STATS
- lazy_flush_smpipi++;
-#endif
}
mtx_unlock_spin(&lazypmap_lock);
if (spins == 0)
@@ -1397,9 +1373,6 @@ pmap_lazyfix(pmap_t pmap)
if (cr3 == rcr3()) {
load_cr3(PCPU_GET(curpcb)->pcb_cr3);
pmap->pm_active &= ~(PCPU_GET(cpumask));
-#ifdef SWTCH_OPTIM_STATS
- lazy_flush_fixup++;
-#endif
}
}
#endif /* SMP */
@@ -3272,9 +3245,6 @@ pmap_activate(struct thread *td)
td->td_pcb->pcb_cr3 = cr3;
}
load_cr3(cr3);
-#ifdef SWTCH_OPTIM_STATS
- tlb_flush_count++;
-#endif
PCPU_SET(curpmap, pmap);
critical_exit();
}
diff --git a/sys/i386/i386/swtch.s b/sys/i386/i386/swtch.s
index 8443b6e..b0a0574 100644
--- a/sys/i386/i386/swtch.s
+++ b/sys/i386/i386/swtch.s
@@ -75,9 +75,6 @@ ENTRY(cpu_throw)
1:
movl 8(%esp),%ecx /* New thread */
movl TD_PCB(%ecx),%edx
-#ifdef SWTCH_OPTIM_STATS
- incl tlb_flush_count
-#endif
movl PCB_CR3(%edx),%eax
movl %eax,%cr3 /* new address space */
/* set bit in new pm_active */
@@ -166,30 +163,16 @@ ENTRY(cpu_switch)
/* switch address space */
movl PCB_CR3(%edx),%eax
#ifdef LAZY_SWITCH
- cmpl $0,lazy_flush_enable
- je 1f
#ifdef PAE
cmpl %eax,IdlePDPT /* Kernel address space? */
#else
cmpl %eax,IdlePTD /* Kernel address space? */
#endif
-#ifdef SWTCH_OPTIM_STATS
- je 3f
-#else
je sw1
#endif
-1:
-#endif
movl %cr3,%ebx /* The same address space? */
cmpl %ebx,%eax
-#ifdef SWTCH_OPTIM_STATS
- je 2f /* Yes, skip all that cruft */
-#else
je sw1
-#endif
-#ifdef SWTCH_OPTIM_STATS
- incl tlb_flush_count
-#endif
movl %eax,%cr3 /* new address space */
/* Release bit from old pmap->pm_active */
@@ -209,19 +192,6 @@ ENTRY(cpu_switch)
#endif
btsl %esi, PM_ACTIVE(%ebx) /* set new */
-#ifdef LAZY_SWITCH
-#ifdef SWTCH_OPTIM_STATS
- jmp sw1
-
-2: /* same address space */
- incl swtch_optim_stats
- jmp sw1
-
-3: /* kernel address space */
- incl lazy_flush_count
-#endif
-#endif
-
sw1:
/*
* At this point, we've switched address spaces and are ready
diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h
index bf3eca4..e8f106d 100644
--- a/sys/i386/include/md_var.h
+++ b/sys/i386/include/md_var.h
@@ -66,22 +66,6 @@ extern int szfreebsd4_sigcode;
#ifdef COMPAT_43
extern int szosigcode;
#endif
-#ifdef SWTCH_OPTIM_STATS
-extern int stupid_switch;
-extern int swtch_optim_stats;
-extern int tlb_flush_count;
-extern int lazy_flush_count;
-extern int lazy_flush_fixup;
-#ifdef SMP
-extern int lazy_flush_smpfixup;
-extern int lazy_flush_smpipi;
-extern int lazy_flush_smpbadcr3;
-extern int lazy_flush_smpmiss;
-#endif
-#endif
-#ifdef LAZY_SWITCH
-extern int lazy_flush_enable;
-#endif
typedef void alias_for_inthand_t(u_int cs, u_int ef, u_int esp, u_int ss);
struct thread;
OpenPOWER on IntegriCloud