freebsd-skq/sys/vm
jhb 1ce407b675 Change the preemption code for software interrupt thread schedules and
mutex releases to not require flags for the cases when preemption is
not allowed:

The purpose of the MTX_NOSWITCH and SWI_NOSWITCH flags is to prevent
switching to a higher priority thread on mutex releease and swi schedule,
respectively when that switch is not safe.  Now that the critical section
API maintains a per-thread nesting count, the kernel can easily check
whether or not it should switch without relying on flags from the
programmer.  This fixes a few bugs in that all current callers of
swi_sched() used SWI_NOSWITCH, when in fact, only the ones called from
fast interrupt handlers and the swi_sched of softclock needed this flag.
Note that to ensure that swi_sched()'s in clock and fast interrupt
handlers do not switch, these handlers have to be explicitly wrapped
in critical_enter/exit pairs.  Presently, just wrapping the handlers is
sufficient, but in the future with the fully preemptive kernel, the
interrupt must be EOI'd before critical_exit() is called.  (critical_exit()
can switch due to a deferred preemption in a fully preemptive kernel.)

I've tested the changes to the interrupt code on i386 and alpha.  I have
not tested ia64, but the interrupt code is almost identical to the alpha
code, so I expect it will work fine.  PowerPC and ARM do not yet have
interrupt code in the tree so they shouldn't be broken.  Sparc64 is
broken, but that's been ok'd by jake and tmm who will be fixing the
interrupt code for sparc64 shortly.

Reviewed by:	peter
Tested on:	i386, alpha
2002-01-05 08:47:13 +00:00
..
default_pager.c
device_pager.c
phys_pager.c
pmap.h
swap_pager.c
swap_pager.h
vm_contig.c
vm_extern.h
vm_fault.c
vm_glue.c Change the preemption code for software interrupt thread schedules and 2002-01-05 08:47:13 +00:00
vm_init.c
vm_kern.c
vm_kern.h
vm_map.c
vm_map.h
vm_meter.c
vm_mmap.c
vm_object.c
vm_object.h
vm_page.c This fixes a large number of bugs in our NFS client side code. A recent 2001-12-14 01:16:57 +00:00
vm_page.h
vm_pageout.c Fix a BUF_TIMELOCK race against BUF_LOCK and fix a deadlock in vget() 2001-12-20 22:42:27 +00:00
vm_pageout.h
vm_pageq.c
vm_pager.c
vm_pager.h
vm_param.h
vm_swap.c
vm_unix.c
vm_zeroidle.c
vm_zone.c
vm_zone.h
vm.h
vnode_pager.c This fixes a large number of bugs in our NFS client side code. A recent 2001-12-14 01:16:57 +00:00
vnode_pager.h