diff options
-rw-r--r-- | sys/conf/options.i386 | 1 | ||||
-rw-r--r-- | sys/conf/options.pc98 | 1 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 38 | ||||
-rw-r--r-- | sys/i386/i386/pmap.c | 34 | ||||
-rw-r--r-- | sys/i386/i386/swtch.s | 30 | ||||
-rw-r--r-- | sys/i386/include/md_var.h | 16 | ||||
-rw-r--r-- | sys/kern/kern_synch.c | 7 |
7 files changed, 2 insertions, 125 deletions
diff --git a/sys/conf/options.i386 b/sys/conf/options.i386 index 9647884..d5ef36d 100644 --- a/sys/conf/options.i386 +++ b/sys/conf/options.i386 @@ -7,7 +7,6 @@ DISABLE_PSE opt_pmap.h PMAP_SHPGPERPROC opt_pmap.h DISABLE_PG_G opt_pmap.h LAZY_SWITCH opt_swtch.h -SWTCH_OPTIM_STATS opt_swtch.h PPC_PROBE_CHIPSET opt_ppc.h PPC_DEBUG opt_ppc.h MAXMEM diff --git a/sys/conf/options.pc98 b/sys/conf/options.pc98 index 454f5fc..8106cbc 100644 --- a/sys/conf/options.pc98 +++ b/sys/conf/options.pc98 @@ -7,7 +7,6 @@ DISABLE_PSE opt_pmap.h PMAP_SHPGPERPROC opt_pmap.h DISABLE_PG_G opt_pmap.h LAZY_SWITCH opt_swtch.h -SWTCH_OPTIM_STATS opt_swtch.h PPC_PROBE_CHIPSET opt_ppc.h PPC_DEBUG opt_ppc.h MAXMEM 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; diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index be11257..6444b97 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -72,9 +72,6 @@ __FBSDID("$FreeBSD$"); #endif #include <machine/cpu.h> -#ifdef SWTCH_OPTIM_STATS -#include <machine/md_var.h> -#endif static void sched_setup(void *dummy); SYSINIT(sched_setup, SI_SUB_KICK_SCHEDULER, SI_ORDER_FIRST, sched_setup, NULL) @@ -525,10 +522,6 @@ mi_switch(void) newtd = choosethread(); if (td != newtd) cpu_switch(td, newtd); /* SHAZAM!! */ -#ifdef SWTCH_OPTIM_STATS - else - stupid_switch++; -#endif #else cpu_switch(); /* SHAZAM!!*/ #endif |