1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00
freebsd/sys/alpha/include
John Baldwin 0c0b25ae91 Implement preemption of kernel threads natively in the scheduler rather
than as one-off hacks in various other parts of the kernel:
- Add a function maybe_preempt() that is called from sched_add() to
  determine if a thread about to be added to a run queue should be
  preempted to directly.  If it is not safe to preempt or if the new
  thread does not have a high enough priority, then the function returns
  false and sched_add() adds the thread to the run queue.  If the thread
  should be preempted to but the current thread is in a nested critical
  section, then the flag TDF_OWEPREEMPT is set and the thread is added
  to the run queue.  Otherwise, mi_switch() is called immediately and the
  thread is never added to the run queue since it is switch to directly.
  When exiting an outermost critical section, if TDF_OWEPREEMPT is set,
  then clear it and call mi_switch() to perform the deferred preemption.
- Remove explicit preemption from ithread_schedule() as calling
  setrunqueue() now does all the correct work.  This also removes the
  do_switch argument from ithread_schedule().
- Do not use the manual preemption code in mtx_unlock if the architecture
  supports native preemption.
- Don't call mi_switch() in a loop during shutdown to give ithreads a
  chance to run if the architecture supports native preemption since
  the ithreads will just preempt DELAY().
- Don't call mi_switch() from the page zeroing idle thread for
  architectures that support native preemption as it is unnecessary.
- Native preemption is enabled on the same archs that supported ithread
  preemption, namely alpha, i386, and amd64.

This change should largely be a NOP for the default case as committed
except that we will do fewer context switches in a few cases and will
avoid the run queues completely when preempting.

Approved by:	scottl (with his re@ hat)
2004-07-02 20:21:44 +00:00
..
pc Remove atdevbase and replace it's remaining uses with direct references to 2004-06-10 20:31:00 +00:00
_inttypes.h
_limits.h Remove the advertsing clause, per the Regent's letter dated July 22, 1999. 2004-04-05 21:00:51 +00:00
_stdint.h <stdint.h> should define WINT_M{AX,IN} independent from whether WCHAR_MIN is 2004-05-18 16:04:57 +00:00
_types.h Introduce the cpumask_t type. The purpose of the type is to create a 2004-03-20 20:41:40 +00:00
alpha_cpu.h
asm.h
atomic.h
bootinfo.h
bus_memio.h
bus_pio.h
bus.h
bwx.h
chipset.h
clock.h
clockvar.h
cpu.h Backed out previous commit. Blind substitution of dev_t by `struct cdev *' 2004-06-20 03:52:50 +00:00
cpuconf.h
cpufunc.h
critical.h
db_machdep.h
elf.h
endian.h Remove the advertsing clause, per the Regent's letter dated July 22, 1999. 2004-04-05 21:00:51 +00:00
exec.h
float.h Hide FLT_EVAL_METHOD and DECIMAL_DIG in pre-C99 compilation 2004-04-25 02:36:29 +00:00
floatingpoint.h
fpu.h Don't clear the exception flags after we finish emulating a 2004-05-06 09:35:57 +00:00
frame.h
ieee.h Remove the advertsing clause, per the Regent's letter dated July 22, 1999. 2004-04-05 21:00:51 +00:00
ieeefp.h
in_cksum.h Remove the advertsing clause, per the Regent's letter dated July 22, 1999. 2004-04-05 21:00:51 +00:00
inst.h
intr.h
intrcnt.h
ioctl_bt848.h
ioctl_meteor.h
limits.h Remove the advertsing clause, per the Regent's letter dated July 22, 1999. 2004-04-05 21:00:51 +00:00
md_var.h
mutex.h
pal.h
param.h Implement preemption of kernel threads natively in the scheduler rather 2004-07-02 20:21:44 +00:00
pcb.h
pcpu.h
pmap.h - Remove unused definitions. 2004-06-23 08:06:52 +00:00
proc.h
profile.h Moved most of the "MI" definitions and declarations from <machine/profile.h> 2004-05-19 15:41:26 +00:00
prom.h
pte.h
ptrace.h Remove the advertsing clause, per the Regent's letter dated July 22, 1999. 2004-04-05 21:00:51 +00:00
reg.h
reloc.h
resource.h
rpb.h
runq.h
setjmp.h
sf_buf.h MFamd64 2004-04-18 06:24:51 +00:00
sgmap.h
sigframe.h
signal.h
smp.h
stdarg.h
swiz.h
sysarch.h Remove the advertsing clause, per the Regent's letter dated July 22, 1999. 2004-04-05 21:00:51 +00:00
ucontext.h
varargs.h
vmparam.h Remove the advertsing clause, per the Regent's letter dated July 22, 1999. 2004-04-05 21:00:51 +00:00