freebsd-dev/sys/amd64/include
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
..
pc use __packed. 2002-09-23 18:54:32 +00:00
_inttypes.h Since printf(3) now supports the `j' conversion specifier, use that 2002-06-30 05:48:03 +00:00
_limits.h Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup, 2003-01-01 18:49:04 +00:00
_stdint.h Create a new header <machine/_stdint.h> for storing MD parts of 2002-07-29 17:41:23 +00:00
_types.h - Add vm_paddr_t, a physical address type. This is required for systems 2003-03-25 00:07:06 +00:00
acpica_machdep.h Resolve conflicts arising from the ACPI CA 20020725 import. 2002-07-30 19:35:32 +00:00
apicreg.h Expand the APIC ID mask field of the ICR register to 8 bits intead of just 2003-03-17 19:14:13 +00:00
asm.h PIC_GOTOFF is OBE. 2002-09-23 07:27:45 +00:00
asmacros.h Silence preprocessor warning, No need to use CONCAT with "," and "word". 2002-06-01 20:22:33 +00:00
atomic.h Add a knob to turn on and off the CMPXCHG instruction on > i386 IA32 systems. 2002-10-14 19:33:12 +00:00
bus_amd64.h - Add support for PAE and more than 4 gigs of ram on x86, dependent on the 2003-03-30 05:24:52 +00:00
bus_at386.h - Add support for PAE and more than 4 gigs of ram on x86, dependent on the 2003-03-30 05:24:52 +00:00
bus_dma.h Implement bus_dmamem_alloc_size() and bus_dmamem_free_size() as 2003-01-29 07:25:27 +00:00
bus_memio.h
bus_pio.h
bus.h Add the following functions/macros to support byte order conversions and 2002-02-27 17:16:18 +00:00
clock.h i386/i386/tsc.c was repo-copied from i386/isa/clock.c. 2003-02-05 09:20:40 +00:00
cpu.h Make get_cyclecount() use binuptime() when no tsc is available: it is cheaper. 2003-02-05 08:55:10 +00:00
cpufunc.h Create inlines for ltr(sel), lldt(sel), lidt(addr) rather than 2002-09-22 04:45:21 +00:00
cputypes.h Move a prototype to the least wrong place. 2002-08-02 18:45:43 +00:00
critical.h Remove the critmode sysctl - the new method for critical_enter/exit (already 2002-07-10 20:15:58 +00:00
db_machdep.h Fill out some gaps in ia64 DDB support. This involves generalising DDB's 2001-09-15 11:06:07 +00:00
elf.h Move the definition of ElfN_Hashelt to common headers. The only platform 2002-05-30 08:32:18 +00:00
endian.h Be careful not to define GCC-specific optimizations in the non-GCC 2002-09-23 04:32:17 +00:00
exec.h
float.h Implement fpclassify(): 2003-02-08 20:37:55 +00:00
floatingpoint.h o Move the contents of <machine/floatingpoint.h> over to 2003-01-19 06:01:33 +00:00
fpu.h At great personal risk, add a __packed and __aligned(x) define that 2002-09-23 05:55:10 +00:00
frame.h Remove __P. 2002-03-20 05:48:58 +00:00
ieeefp.h o Move the contents of <machine/floatingpoint.h> over to 2003-01-19 06:01:33 +00:00
in_cksum.h
kse.h Add files that are new for KSE. 2002-06-29 07:04:59 +00:00
legacyvar.h Add a new legacy(4) device driver for use on machines that do not have 2002-09-23 15:50:06 +00:00
limits.h Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup, 2003-01-01 18:49:04 +00:00
md_var.h Commit a partial lazy thread switch mechanism for i386. it isn't as lazy 2003-04-02 23:53:30 +00:00
mptable.h Commit a partial lazy thread switch mechanism for i386. it isn't as lazy 2003-04-02 23:53:30 +00:00
mutex.h GC #if 0'd assembly mutex micro operations. If someone wants to bring 2002-03-28 15:14:23 +00:00
npx.h At great personal risk, add a __packed and __aligned(x) define that 2002-09-23 05:55:10 +00:00
param.h Initiate deorbit burn for the i386-only a.out related support. Moves are 2002-09-17 01:49:00 +00:00
pcb_ext.h Remove __P. 2002-03-20 05:48:58 +00:00
pcb.h 1.Fix smp race between kernel vm86 BIOS calling and userland vm86 mode code, 2002-11-07 01:34:23 +00:00
pci_cfgreg.h Initiate de-orbit burn for USE_PCI_BIOS_FOR_READ_WRITE. This has been 2003-02-18 03:36:49 +00:00
pcpu.h A more lint friendly #ifdef lint section. 2002-10-01 14:01:58 +00:00
pmap.h Commit a partial lazy thread switch mechanism for i386. it isn't as lazy 2003-04-02 23:53:30 +00:00
proc.h Note that the sched_lock protects md_ldt of struct mdproc. 2002-10-25 20:06:16 +00:00
profile.h Fix a declaration that is actually supposed to be a macro definition. 2002-09-25 13:46:23 +00:00
psl.h Allow bit 21 of EFLAGS register (PSL_ID) be changed in the use-mode without 2001-11-15 23:01:29 +00:00
ptrace.h Move the definition of PT_[GS]ET{,DB,FP}REGS from the MD ptrace.h to the 2002-03-16 00:25:53 +00:00
reg.h Properly parenthesize the DBREG_DRX macro's variables to allow for 2002-11-07 22:42:31 +00:00
reloc.h
resource.h
runq.h Move the "- 1" into the RQB_FFS(mask) macro itself so that 2002-06-20 06:21:20 +00:00
segments.h Remove BDE_DEBUGGER. 2003-01-28 19:05:44 +00:00
setjmp.h Fix namespace issues by using visibility conditionals from 2002-10-05 05:47:56 +00:00
sigframe.h Split 4.x and 5.x signal handling so that we can keep 4.x signal 2002-10-25 19:10:58 +00:00
signal.h Align the FPU state in the ucontext and sigcontext to 16 bytes 2002-12-02 19:58:55 +00:00
smp.h Commit a partial lazy thread switch mechanism for i386. it isn't as lazy 2003-04-02 23:53:30 +00:00
specialreg.h Bah, add in a missing space char I noticed when MFC'ing this. 2003-01-22 17:26:18 +00:00
stdarg.h o Add conditionals to allow va_list to be defined in other headers. 2002-10-06 22:01:07 +00:00
sysarch.h There is no need for start/num to be signed in i386_ldt_args. 2002-09-28 20:42:04 +00:00
trap.h Activate SSE/SIMD. This is the extra context switching support that 2001-07-12 06:32:51 +00:00
tss.h Delete a whole bunch of compatability defines that we dont use anymore. 2002-09-23 05:04:05 +00:00
ucontext.h Align the FPU state in the ucontext and sigcontext to 16 bytes 2002-12-02 19:58:55 +00:00
varargs.h Add conditionals to allow va_list to be defined in other headers. 2002-10-06 22:02:06 +00:00
vmparam.h - Removed UMAXPTDI and UMAXPTEOFF. 2003-02-24 20:29:52 +00:00