aboutsummaryrefslogtreecommitdiff
path: root/sys/conf
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2003-04-02 23:53:30 +0000
committerPeter Wemm <peter@FreeBSD.org>2003-04-02 23:53:30 +0000
commitcc66ebe2a9c6a435e7bb694ab47f2c98e6ee7eb2 (patch)
tree4ec7883ecb294f0c60d2aa5a5a0b58973fafc545 /sys/conf
parent996a395d37653e13a8b18f6bf5d943b12ab05b49 (diff)
downloadsrc-cc66ebe2a9c6a435e7bb694ab47f2c98e6ee7eb2.tar.gz
src-cc66ebe2a9c6a435e7bb694ab47f2c98e6ee7eb2.zip
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
Notes
Notes: svn path=/head/; revision=112993
Diffstat (limited to 'sys/conf')
-rw-r--r--sys/conf/options.i3862
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/conf/options.i386 b/sys/conf/options.i386
index 868cfbdb6546..de784be34666 100644
--- a/sys/conf/options.i386
+++ b/sys/conf/options.i386
@@ -6,6 +6,8 @@ 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
+SWTCH_OPTIM_STATS opt_swtch.h
PPC_PROBE_CHIPSET opt_ppc.h
PPC_DEBUG opt_ppc.h
MAXMEM