freebsd-dev/sys
David Xu 0dbb100b9b Move UPCALL related data structure out of kse, introduce a new
data structure called kse_upcall to manage UPCALL. All KSE binding
and loaning code are gone.

A thread owns an upcall can collect all completed syscall contexts in
its ksegrp, turn itself into UPCALL mode, and takes those contexts back
to userland. Any thread without upcall structure has to export their
contexts and exit at user boundary.

Any thread running in user mode owns an upcall structure, when it enters
kernel, if the kse mailbox's current thread pointer is not NULL, then
when the thread is blocked in kernel, a new UPCALL thread is created and
the upcall structure is transfered to the new UPCALL thread. if the kse
mailbox's current thread pointer is NULL, then when a thread is blocked
in kernel, no UPCALL thread will be created.

Each upcall always has an owner thread. Userland can remove an upcall by
calling kse_exit, when all upcalls in ksegrp are removed, the group is
atomatically shutdown. An upcall owner thread also exits when process is
in exiting state. when an owner thread exits, the upcall it owns is also
removed.

KSE is a pure scheduler entity. it represents a virtual cpu. when a thread
is running, it always has a KSE associated with it. scheduler is free to
assign a KSE to thread according thread priority, if thread priority is changed,
KSE can be moved from one thread to another.

When a ksegrp is created, there is always N KSEs created in the group. the
N is the number of physical cpu in the current system. This makes it is
possible that even an userland UTS is single CPU safe, threads in kernel still
can execute on different cpu in parallel. Userland calls kse_create to add more
upcall structures into ksegrp to increase concurrent in userland itself, kernel
is not restricted by number of upcalls userland provides.

The code hasn't been tested under SMP by author due to lack of hardware.

Reviewed by: julian
2003-01-26 11:41:35 +00:00
..
alpha Move UPCALL related data structure out of kse, introduce a new 2003-01-26 11:41:35 +00:00
amd64 Move UPCALL related data structure out of kse, introduce a new 2003-01-26 11:41:35 +00:00
arm MB_LEN_MAX is not MD, move it to the MI limits.h. 2002-12-22 06:38:45 +00:00
boot Use NDOSPART instead of NEXTDOSPART. 2003-01-21 13:59:53 +00:00
cam Remove redundant printf from targbhasync() since all places that return an 2003-01-23 21:55:12 +00:00
coda Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
compat Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
conf - Add entries for scheduler selection 2003-01-26 05:35:54 +00:00
contrib Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
crypto Remove some unnecessary casts. 2003-01-25 22:41:22 +00:00
ddb Move UPCALL related data structure out of kse, introduce a new 2003-01-26 11:41:35 +00:00
dev Put use of DIOCWLABEL under #ifdef NO_GEOM 2003-01-26 11:28:56 +00:00
fs Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
geom Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
gnu Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
i4b Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
i386 Move UPCALL related data structure out of kse, introduce a new 2003-01-26 11:41:35 +00:00
ia64 Move UPCALL related data structure out of kse, introduce a new 2003-01-26 11:41:35 +00:00
isa YAM: This id is found in a Sony Vaio GRX-670. When will this end? 2003-01-22 22:02:09 +00:00
isofs/cd9660 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
kern Move UPCALL related data structure out of kse, introduce a new 2003-01-26 11:41:35 +00:00
libkern Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
modules Add ac97_patch.[ch] that provide space for ac97 codec specific patches. 2003-01-25 16:54:05 +00:00
net - add support for IPX (tested with mount -t nwfs and mars_nwe), 2003-01-24 01:32:20 +00:00
netatalk Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
netatm Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
netgraph Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
netinet Merge the best parts of maxfragpackets and maxnipq together. (Both 2003-01-26 01:44:05 +00:00
netinet6 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
netipsec Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
netipx add forgotten IFA_LOCK_INIT 2003-01-23 23:36:45 +00:00
netkey Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
netnatm Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
netncp Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
netns Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
netsmb Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
nfs Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
nfsclient Provide a sysctl to allow defaulting of the connectionless (-c) feature 2003-01-22 19:57:31 +00:00
nfsserver Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
opencrypto Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
pc98 - Introduce the SCHED_ULE and SCHED_4BSD options for compile time selection 2003-01-26 05:29:12 +00:00
pccard Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
pci Remove the now unused sys/malloc.h header. 2003-01-24 02:42:22 +00:00
posix4 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
powerpc Move UPCALL related data structure out of kse, introduce a new 2003-01-26 11:41:35 +00:00
rpc
security Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
sparc64 Move UPCALL related data structure out of kse, introduce a new 2003-01-26 11:41:35 +00:00
sys Move UPCALL related data structure out of kse, introduce a new 2003-01-26 11:41:35 +00:00
tools Remove miidevs.h and generate it from miidevs at compile time. 2003-01-19 02:59:34 +00:00
ufs Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
vm Add MTX_DUPOK to the initialization of system map locks. 2003-01-25 18:45:55 +00:00
Makefile Milestone #1 in cross-arch make releases. 2002-04-26 17:55:27 +00:00