unifdef -DLAZY_SWITCH and start to tidy up the associated glue.

This commit is contained in:
Peter Wemm 2003-07-10 01:02:59 +00:00
parent 1b3fa2f2c1
commit e95babf3a8
15 changed files with 3 additions and 49 deletions

View File

@ -3,8 +3,6 @@
* $FreeBSD$
*/
#include "opt_swtch.h"
#include <machine/apic.h>
#include <machine/smp.h>
@ -643,7 +641,6 @@ IDTVEC(rendezvous)
POP_FRAME
iret
#ifdef LAZY_SWITCH
/*
* Clean up when we lose out on the lazy context switch optimization.
* ie: when we are about to release a PTD but a cpu is still borrowing it.
@ -662,7 +659,6 @@ IDTVEC(lazypmap)
movl $0, lapic+LA_EOI /* End Of Interrupt to APIC */
POP_FRAME
iret
#endif
#endif /* SMP */
.data

View File

@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$");
#include "opt_cpu.h"
#include "opt_kstack_pages.h"
#include "opt_swtch.h"
#ifdef SMP
#include <machine/smptests.h>
@ -644,11 +643,9 @@ mp_enable(u_int boot_addr)
setidt(XSTATCLOCK_OFFSET, Xstatclock,
SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
#ifdef LAZY_SWITCH
/* install an inter-CPU IPI for lazy pmap release */
setidt(XLAZYPMAP_OFFSET, Xlazypmap,
SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
#endif
/* install an inter-CPU IPI for all-CPU rendezvous */
setidt(XRENDEZVOUS_OFFSET, Xrendezvous,

View File

@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$");
#include "opt_cpu.h"
#include "opt_kstack_pages.h"
#include "opt_swtch.h"
#ifdef SMP
#include <machine/smptests.h>
@ -644,11 +643,9 @@ mp_enable(u_int boot_addr)
setidt(XSTATCLOCK_OFFSET, Xstatclock,
SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
#ifdef LAZY_SWITCH
/* install an inter-CPU IPI for lazy pmap release */
setidt(XLAZYPMAP_OFFSET, Xlazypmap,
SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
#endif
/* install an inter-CPU IPI for all-CPU rendezvous */
setidt(XRENDEZVOUS_OFFSET, Xrendezvous,

View File

@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$");
#include "opt_cpu.h"
#include "opt_kstack_pages.h"
#include "opt_swtch.h"
#ifdef SMP
#include <machine/smptests.h>
@ -644,11 +643,9 @@ mp_enable(u_int boot_addr)
setidt(XSTATCLOCK_OFFSET, Xstatclock,
SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
#ifdef LAZY_SWITCH
/* install an inter-CPU IPI for lazy pmap release */
setidt(XLAZYPMAP_OFFSET, Xlazypmap,
SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
#endif
/* install an inter-CPU IPI for all-CPU rendezvous */
setidt(XRENDEZVOUS_OFFSET, Xrendezvous,

View File

@ -6,7 +6,6 @@ GPL_MATH_EMULATE opt_math_emulate.h
DISABLE_PSE opt_pmap.h
PMAP_SHPGPERPROC opt_pmap.h
DISABLE_PG_G opt_pmap.h
LAZY_SWITCH opt_swtch.h
PPC_PROBE_CHIPSET opt_ppc.h
PPC_DEBUG opt_ppc.h
MAXMEM

View File

@ -6,7 +6,6 @@ GPL_MATH_EMULATE opt_math_emulate.h
DISABLE_PSE opt_pmap.h
PMAP_SHPGPERPROC opt_pmap.h
DISABLE_PG_G opt_pmap.h
LAZY_SWITCH opt_swtch.h
PPC_PROBE_CHIPSET opt_ppc.h
PPC_DEBUG opt_ppc.h
MAXMEM

View File

@ -3,8 +3,6 @@
* $FreeBSD$
*/
#include "opt_swtch.h"
#include <machine/apic.h>
#include <machine/smp.h>
@ -643,7 +641,6 @@ IDTVEC(rendezvous)
POP_FRAME
iret
#ifdef LAZY_SWITCH
/*
* Clean up when we lose out on the lazy context switch optimization.
* ie: when we are about to release a PTD but a cpu is still borrowing it.
@ -662,7 +659,6 @@ IDTVEC(lazypmap)
movl $0, lapic+LA_EOI /* End Of Interrupt to APIC */
POP_FRAME
iret
#endif
#endif /* SMP */
.data

View File

@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$");
#include "opt_cpu.h"
#include "opt_kstack_pages.h"
#include "opt_swtch.h"
#ifdef SMP
#include <machine/smptests.h>
@ -644,11 +643,9 @@ mp_enable(u_int boot_addr)
setidt(XSTATCLOCK_OFFSET, Xstatclock,
SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
#ifdef LAZY_SWITCH
/* install an inter-CPU IPI for lazy pmap release */
setidt(XLAZYPMAP_OFFSET, Xlazypmap,
SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
#endif
/* install an inter-CPU IPI for all-CPU rendezvous */
setidt(XRENDEZVOUS_OFFSET, Xrendezvous,

View File

@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$");
#include "opt_cpu.h"
#include "opt_kstack_pages.h"
#include "opt_swtch.h"
#ifdef SMP
#include <machine/smptests.h>
@ -644,11 +643,9 @@ mp_enable(u_int boot_addr)
setidt(XSTATCLOCK_OFFSET, Xstatclock,
SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
#ifdef LAZY_SWITCH
/* install an inter-CPU IPI for lazy pmap release */
setidt(XLAZYPMAP_OFFSET, Xlazypmap,
SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
#endif
/* install an inter-CPU IPI for all-CPU rendezvous */
setidt(XRENDEZVOUS_OFFSET, Xrendezvous,

View File

@ -104,7 +104,6 @@ __FBSDID("$FreeBSD$");
#include "opt_pmap.h"
#include "opt_msgbuf.h"
#include "opt_kstack_pages.h"
#include "opt_swtch.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -187,7 +186,7 @@ struct pmap kernel_pmap_store;
LIST_HEAD(pmaplist, pmap);
static struct pmaplist allpmaps;
static struct mtx allpmaps_lock;
#if defined(SMP) && defined(LAZY_SWITCH)
#ifdef SMP
static struct mtx lazypmap_lock;
#endif
@ -340,7 +339,7 @@ pmap_bootstrap(firstaddr, loadaddr)
kernel_pmap->pm_active = -1; /* don't allow deactivation */
TAILQ_INIT(&kernel_pmap->pm_pvlist);
LIST_INIT(&allpmaps);
#if defined(SMP) && defined(LAZY_SWITCH)
#ifdef SMP
mtx_init(&lazypmap_lock, "lazypmap", NULL, MTX_SPIN);
#endif
mtx_init(&allpmaps_lock, "allpmaps", NULL, MTX_SPIN);
@ -1285,7 +1284,6 @@ pmap_allocpte(pmap_t pmap, vm_offset_t va)
* Pmap allocation/deallocation routines.
***************************************************/
#ifdef LAZY_SWITCH
#ifdef SMP
/*
* Deal with a SMP shootdown of other users of the pmap that we are
@ -1374,7 +1372,6 @@ pmap_lazyfix(pmap_t pmap)
}
}
#endif /* SMP */
#endif /* LAZY_SWITCH */
/*
* Release any resources held by the given physical map.
@ -1397,9 +1394,7 @@ pmap_release(pmap_t pmap)
("pmap_release: pmap resident count %ld != 0",
pmap->pm_stats.resident_count));
#ifdef LAZY_SWITCH
pmap_lazyfix(pmap);
#endif
mtx_lock_spin(&allpmaps_lock);
LIST_REMOVE(pmap, pm_list);
mtx_unlock_spin(&allpmaps_lock);

View File

@ -37,7 +37,6 @@
*/
#include "opt_npx.h"
#include "opt_swtch.h"
#include <machine/asmacros.h>
@ -162,14 +161,12 @@ ENTRY(cpu_switch)
/* switch address space */
movl PCB_CR3(%edx),%eax
#ifdef LAZY_SWITCH
#ifdef PAE
cmpl %eax,IdlePDPT /* Kernel address space? */
#else
cmpl %eax,IdlePTD /* Kernel address space? */
#endif
je sw1
#endif
movl %cr3,%ebx /* The same address space? */
cmpl %ebx,%eax
je sw1

View File

@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$");
#include "opt_cpu.h"
#include "opt_kstack_pages.h"
#include "opt_swtch.h"
#ifdef SMP
#include <machine/smptests.h>
@ -644,11 +643,9 @@ mp_enable(u_int boot_addr)
setidt(XSTATCLOCK_OFFSET, Xstatclock,
SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
#ifdef LAZY_SWITCH
/* install an inter-CPU IPI for lazy pmap release */
setidt(XLAZYPMAP_OFFSET, Xlazypmap,
SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
#endif
/* install an inter-CPU IPI for all-CPU rendezvous */
setidt(XRENDEZVOUS_OFFSET, Xrendezvous,

View File

@ -3,8 +3,6 @@
* $FreeBSD$
*/
#include "opt_swtch.h"
#include <machine/apic.h>
#include <machine/smp.h>
@ -643,7 +641,6 @@ IDTVEC(rendezvous)
POP_FRAME
iret
#ifdef LAZY_SWITCH
/*
* Clean up when we lose out on the lazy context switch optimization.
* ie: when we are about to release a PTD but a cpu is still borrowing it.
@ -662,7 +659,6 @@ IDTVEC(lazypmap)
movl $0, lapic+LA_EOI /* End Of Interrupt to APIC */
POP_FRAME
iret
#endif
#endif /* SMP */
.data

View File

@ -43,9 +43,6 @@ __FBSDID("$FreeBSD$");
#include "opt_ddb.h"
#include "opt_ktrace.h"
#ifdef __i386__
#include "opt_swtch.h"
#endif
#include <sys/param.h>
#include <sys/systm.h>

View File

@ -86,9 +86,6 @@ __FBSDID("$FreeBSD$");
#include "opt_ddb.h"
#include "opt_witness.h"
#ifdef __i386__
#include "opt_swtch.h"
#endif
#include <sys/param.h>
#include <sys/bus.h>
@ -301,7 +298,7 @@ static struct witness_order_list_entry order_lists[] = {
#if defined(__i386__) && defined(APIC_IO)
{ "tlb", &lock_class_mtx_spin },
#endif
#if defined(__i386__) && defined(LAZY_SWITCH)
#ifdef __i386__
{ "lazypmap", &lock_class_mtx_spin },
#endif
#ifdef __sparc64__