freebsd-src/sys
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
..
alpha - Define a new md function 'casuptr'. This atomically compares and sets 2003-04-01 00:18:55 +00:00
amd64 Commit a partial lazy thread switch mechanism for i386. it isn't as lazy 2003-04-02 23:53:30 +00:00
arm - Add vm_paddr_t, a physical address type. This is required for systems 2003-03-25 00:07:06 +00:00
boot FreeBSD 5.0 has stopped shipping /modules 2.5 years ago. Catch 2003-03-11 12:09:25 +00:00
cam Use bioq_flush() to drain a bio queue with a specific error code. 2003-04-01 15:06:26 +00:00
coda - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread with 2003-03-31 22:49:17 +00:00
compat Add #include <sys/conf.h> so we don't rely on <sys/disk.h> doing it. 2003-04-01 12:34:47 +00:00
conf Commit a partial lazy thread switch mechanism for i386. it isn't as lazy 2003-04-02 23:53:30 +00:00
contrib Use bioq_flush() to drain a bio queue with a specific error code. 2003-04-01 15:06:26 +00:00
crypto Remove some unnecessary casts. 2003-01-25 22:41:22 +00:00
ddb Change the process flags P_KSES to be P_THREADED. 2003-02-27 02:05:19 +00:00
dev Convert the fxp(4) driver to the busdma API. 2003-04-02 16:47:16 +00:00
fs - smb_td_intr takes a thread as an argument not a proc. 2003-04-01 09:24:12 +00:00
geom Add handling for cancelled events in the g_call_me() methods. 2003-04-02 21:10:04 +00:00
gnu - Lock the buf before clearing flags. 2003-03-13 07:07:16 +00:00
i4b - Add vm_paddr_t, a physical address type. This is required for systems 2003-03-25 00:07:06 +00:00
i386 Commit a partial lazy thread switch mechanism for i386. it isn't as lazy 2003-04-02 23:53:30 +00:00
ia64 Use bioq_flush() to drain a bio queue with a specific error code. 2003-04-01 15:06:26 +00:00
isa Use bioq_flush() to drain a bio queue with a specific error code. 2003-04-01 15:06:26 +00:00
isofs/cd9660 Rename vfs_stdsync function to vfs_stdnosync which matches more 2003-03-11 22:15:10 +00:00
kern Commit a partial lazy thread switch mechanism for i386. it isn't as lazy 2003-04-02 23:53:30 +00:00
libkern Further GC of M_STRING, missed previously. 2003-02-26 01:00:29 +00:00
modules opt_geom.h is no longer required for this module. 2003-03-29 16:13:11 +00:00
net o netisr_queue() returns 1 on success and 0 on failure, 2003-03-27 12:52:57 +00:00
netatalk - Use if_broadcastaddr from struct ifnet rather than relying on 2003-03-21 17:53:16 +00:00
netatm Update netisr handling; Each SWI now registers its queue, and all queue 2003-03-04 23:19:55 +00:00
netgraph Include correct opt_* headers for supported address families. Dike out 2003-03-08 16:25:27 +00:00
netinet Back out support for RFC3514. 2003-04-02 20:14:44 +00:00
netinet6 fixed a mbuf leak when an IP packet from ESP tunnel is redirected 2003-03-29 08:31:28 +00:00
netipsec add missing copyright notices 2003-03-28 20:28:05 +00:00
netipx Remove unimplemented IP-in-IPX encapsulation support (options IPTUNNEL). 2003-03-08 06:58:22 +00:00
netkey Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
netnatm Update netisr handling; Each SWI now registers its queue, and all queue 2003-03-04 23:19:55 +00:00
netncp - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread with 2003-03-31 22:49:17 +00:00
netsmb - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread with 2003-03-31 22:49:17 +00:00
nfs Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
nfsclient Revert change 1.201 (removing mapping of VAPPEND to VWRITE). 2003-03-31 23:26:10 +00:00
nfsserver - Lock bufs before inspecting their flags. 2003-03-13 07:05:22 +00:00
opencrypto Gigacommit to improve device-driver source compatibility between 2003-03-03 12:15:54 +00:00
pc98 MFi386: revisions 1.556 and 1.557. 2003-04-02 10:51:06 +00:00
pccard Gigacommit to improve device-driver source compatibility between 2003-03-03 12:15:54 +00:00
pci Fix KASSERT syntax error. 2003-04-01 08:57:28 +00:00
posix4 Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
powerpc - Define a new md function 'casuptr'. This atomically compares and sets 2003-04-01 00:18:55 +00:00
rpc
security Trim "trustedbsd_" from the front of the policy module "short names"; 2003-03-27 19:26:39 +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
sys Commit a partial lazy thread switch mechanism for i386. it isn't as lazy 2003-04-02 23:53:30 +00:00
tools MFp4: 2003-03-28 06:43:50 +00:00
ufs Check return value from vmapbuf instead of the function address. 2003-03-27 20:48:34 +00:00
vm Add a facility allowing processes to inform the VM subsystem they are 2003-03-31 21:09:57 +00:00
Makefile