freebsd-nq/sys/sparc64
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
..
central Use M_WAITOK. 2003-02-19 17:25:58 +00:00
compile Obrien created this directory, but I didn't cvs add cvsignore 2001-07-01 23:37:03 +00:00
conf Remove bitrot associated with `maxusers'. 2003-03-22 14:18:23 +00:00
ebus Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
fhc Fix definite panic when releasing interrupt resources. 2003-02-19 19:40:40 +00:00
include - Add a flags field to struct pcb. Use this to keep track of wether or 2003-04-01 04:58:50 +00:00
isa Add two new workaround for firmware anomalies: 2002-11-07 16:07:46 +00:00
pci Set the cache line size for subordinate pci bridges as well as for their 2003-03-27 02:01:59 +00:00
sbus Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
sparc64 Commit a partial lazy thread switch mechanism for i386. it isn't as lazy 2003-04-02 23:53:30 +00:00