freebsd-dev/sys/amd64/isa
Peter Wemm cc66ebe2a9 Commit a partial lazy thread switch mechanism for i386. it isn't as lazy
as it could be and can do with some more cleanup.  Currently its under
options LAZY_SWITCH.  What this does is avoid %cr3 reloads for short
context switches that do not involve another user process.  ie: we can
take an interrupt, switch to a kthread and return to the user without
explicitly flushing the tlb.  However, this isn't as exciting as it could
be, the interrupt overhead is still high and too much blocks on Giant
still.  There are some debug sysctls, for stats and for an on/off switch.

The main problem with doing this has been "what if the process that you're
running on exits while we're borrowing its address space?" - in this case
we use an IPI to give it a kick when we're about to reclaim the pmap.

Its not compiled in unless you add the LAZY_SWITCH option.  I want to fix a
few more things and get some more feedback before turning it on by default.

This is NOT a replacement for Bosko's lazy interrupt stuff.  This was more
meant for the kthread case, while his was for interrupts.  Mine helps a
little for interrupts, but his helps a lot more.

The stats are enabled with options SWTCH_OPTIM_STATS - this has been a
pseudo-option for years, I just added a bunch of stuff to it.

One non-trivial change was to select a new thread before calling
cpu_switch() in the first place.  This allows us to catch the silly
case of doing a cpu_switch() to the current process.  This happens
uncomfortably often.  This simplifies a bit of the asm code in cpu_switch
(no longer have to call choosethread() in the middle).  This has been
implemented on i386 and (thanks to jake) sparc64.  The others will come
soon.  This is actually seperate to the lazy switch stuff.

Glanced at by:  jake, jhb
2003-04-02 23:53:30 +00:00
..
atpic_vector.S Move ICU_* defines into icu.h. 2002-04-06 08:25:05 +00:00
clock.c Use repo-copied files in sys/i386/bios. 2003-03-24 19:14:46 +00:00
icu_ipl.s Move ICU_* defines into icu.h. 2002-04-06 08:25:05 +00:00
icu_ipl.S Move ICU_* defines into icu.h. 2002-04-06 08:25:05 +00:00
icu_vector.s Move ICU_* defines into icu.h. 2002-04-06 08:25:05 +00:00
icu_vector.S Move ICU_* defines into icu.h. 2002-04-06 08:25:05 +00:00
icu.h Move ICU_* defines into icu.h. 2002-04-06 08:25:05 +00:00
intr_machdep.c Use repo-copied files in sys/i386/bios. 2003-03-24 19:14:46 +00:00
intr_machdep.h Commit a partial lazy thread switch mechanism for i386. it isn't as lazy 2003-04-02 23:53:30 +00:00
isa_dma.c - Add vm_paddr_t, a physical address type. This is required for systems 2003-03-25 00:07:06 +00:00
isa_dma.h Remove __P. 2002-03-20 07:51:46 +00:00
isa.c - Split the routine to initialize a bus_space_handle into the separate 2002-02-17 09:16:45 +00:00
isa.h
ithread.c Removed unused includes. In particular, don't include <isa/isavar.h> since 2002-01-30 12:23:49 +00:00
nmi.c Use repo-copied files in sys/i386/bios. 2003-03-24 19:14:46 +00:00
npx.c - In npxgetregs() use the td argument to save the fpu state from and not 2003-04-01 00:16:32 +00:00
timerreg.h
vector.s Introduce a standard name for the lock protecting an interrupt controller 2001-12-20 23:48:31 +00:00
vector.S Introduce a standard name for the lock protecting an interrupt controller 2001-12-20 23:48:31 +00:00