freebsd-nq/sys/i386
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
..
acpica Export the physical address of the RSDP to userland by means 2002-12-18 08:47:07 +00:00
apm Be consistent about functions being static. 2002-10-16 08:57:14 +00:00
bios - Removed unecesary code. 2003-01-18 04:36:12 +00:00
compile Don't need the .keep_me files. Obrien and I committed past each other. 2001-07-01 23:35:44 +00:00
conf - Remove a redundant scheduler option. 2003-01-26 06:37:43 +00:00
i386 Move UPCALL related data structure out of kse, introduce a new 2003-01-26 11:41:35 +00:00
ibcs2 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
include Clean up some junk defines, and GC the TPR options. 2003-01-23 01:04:27 +00:00
isa Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
linux Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
pci Outdent the string rather than use concatenation. 2002-12-23 22:12:17 +00:00
smapi - Removed unecesary code. 2003-01-18 04:36:12 +00:00
svr4 SCARGS removal take II. 2002-12-14 01:56:26 +00:00
Makefile This commit adds basic support for the UFS2 filesystem. The UFS2 2002-06-21 06:18:05 +00:00