freebsd-skq/sys/ddb
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
..
db_access.c
db_access.h Remove __P. 2002-03-20 05:14:42 +00:00
db_break.c - Add a function db_alt_break which recognizes the character sequence used to 2002-12-31 06:51:19 +00:00
db_break.h Revert previous and move the prototype for db_alt_break to ddb.h. 2002-12-31 18:30:53 +00:00
db_command.c Add code to ddb to allow backtracing an arbitrary thread. 2002-12-28 01:23:07 +00:00
db_command.h Remove __P. 2002-03-20 05:14:42 +00:00
db_elf.c Garbage-collected __ELF__ ifdefs. 2002-09-15 22:28:39 +00:00
db_examine.c - Rename the DDB specific %z printf format to %y. 2002-10-25 19:41:32 +00:00
db_expr.c Don't assume that pointers are 4 bytes or sizeof(int) in size. This fixes 2002-06-25 15:59:24 +00:00
db_input.c Be consistent about "static" functions: if the function is marked 2002-09-28 17:15:38 +00:00
db_kld.c Reconnect db_elf.c to the build (now under "options DDB_NOKLDSYM"). It 2002-05-07 10:59:52 +00:00
db_lex.c Remove __P. 2002-03-20 05:14:42 +00:00
db_lex.h Remove __P. 2002-03-20 05:14:42 +00:00
db_output.c Remove __P. 2002-03-20 05:14:42 +00:00
db_output.h Remove __P. 2002-03-20 05:14:42 +00:00
db_print.c
db_ps.c Move UPCALL related data structure out of kse, introduce a new 2003-01-26 11:41:35 +00:00
db_run.c Split the declaration and the initialization of two variables. 2002-06-23 20:03:03 +00:00
db_sym.c Remove __P. 2002-03-20 05:14:42 +00:00
db_sym.h When talking about c_db_sym_t, mention that it is not just like db_sym_t: 2002-08-14 17:56:47 +00:00
db_sysctl.c
db_trap.c A set of changes to reduce the number of include files the kernel 2001-07-08 04:56:07 +00:00
db_variables.c Remove __P. 2002-03-20 05:14:42 +00:00
db_variables.h Remove __P. 2002-03-20 05:14:42 +00:00
db_watch.c Be consistent about "static" functions: if the function is marked 2002-09-28 17:15:38 +00:00
db_watch.h
db_write_cmd.c
ddb.h Revert previous and move the prototype for db_alt_break to ddb.h. 2002-12-31 18:30:53 +00:00