Cleanup P_CURPROC and P_CP_RELEASED handling. P_CP_RELEASED prevents the
authorMatthew Dillon <dillon@dragonflybsd.org>
Fri, 17 Oct 2003 07:30:43 +0000 (07:30 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Fri, 17 Oct 2003 07:30:43 +0000 (07:30 +0000)
commit435ff99355a95aa1f228293f80b5b4ea1b692643
treec15c8d0e2394d15ddd50068d7856ecafbcf2bf28
parentba023347f7df43d32d69d1060fea55e804948861
Cleanup P_CURPROC and P_CP_RELEASED handling.  P_CP_RELEASED prevents the
userland scheduler from messing with a process and must be set (in a lazy
fashion) when a thread that came in from userland is about to block in
the kernel.  P_CURPROC is used to manage which threads belonging to
processes controlled by the userland scheduler are scheduled by LWKT.
The userland scheduler has also been streamlined considerably.

p_priority now has a rollup priority that can be compared directly,
regardless of the realtime/idle/whatever queue a process is on.
p_priority has been changed from an unsigned char to a signed short.

schedclock is now distributed, so 'top' shows the correct values.

A huge amount of cpu affinity code has been added to the scheduler.  It is
not working 100% yet, but the framework is there (see kern/kern_switch.c).
globaldata now has gd_upri to support remote reschedule requests issued
by the affinity code.  There are two goals to the new scheduling code for
MP boxes: (1) so niced/idleprio cpu bound programs do not interfere
*at* *all* with other things (like, say, a buildworld).  (2) to reduce
the flip-flopping of processes between cpus.

lwkt_gettoken() now increments the generation number unconditionally so
kernel code can detect when other processes have used a token.

lwkt_send_ipiq_mask() removes stopped cpus from the mask automatically.
sys/i386/i386/trap.c
sys/kern/kern_clock.c
sys/kern/kern_exit.c
sys/kern/kern_switch.c
sys/kern/kern_synch.c
sys/kern/lwkt_thread.c
sys/platform/pc32/i386/trap.c
sys/sys/globaldata.h
sys/sys/param.h
sys/sys/proc.h