minix/include/minix
Tomas Hruby b09bcf6779 Scheduling server (by Bjorn Swift)
In this second phase, scheduling is moved from PM to its own
scheduler (see r6557 for phase one). In the next phase we hope to a)
include useful information in the "out of quantum" message and b)
create some simple scheduling policy that makes use of that
information.

When the system starts up, PM will iterate over its process table and
ask SCHED to take over scheduling unprivileged processes. This is
done by sending a SCHEDULING_START message to SCHED. This message
includes the processes endpoint, the parent's endpoint and its nice
level. The scheduler adds this process to its schedproc table, issues
a schedctl, and returns its own endpoint to PM - as the endpoint of
the effective scheduler. When a process terminates, a SCHEDULING_STOP
message is sent to the scheduler.

The reason for this effective endpoint is for future compatibility.
Some day, we may have a scheduler that, instead of scheduling the
process itself, forwards the SCHEDULING_START message on to another
scheduler.

PM has information on who schedules whom. As such, scheduling
messages from user-land are sent through PM. An example is when
processes change their priority, using nice(). In that case, a
getsetpriority message is sent to PM, which then sends a
SCHEDULING_SET_NICE to the process's effective scheduler.

When a process is forked through PM, it inherits its parent's
scheduler, but is spawned with an empty quantum. As before, a request
to fork a process flows through VM before returning to PM, which then
wakes up the child process. This flow has been modified slightly so
that PM notifies the scheduler of the new process, before waking up
the child process. If the scheduler fails to take over scheduling,
the child process is torn down and the fork fails with an erroneous
value.

Process priority is entirely decided upon using nice levels. PM
stores a copy of each process's nice level and when a child is
forked, its parent's nice level is sent in the SCHEDULING_START
message. How this level is mapped to a priority queue is up to the
scheduler. It should be noted that the nice level is used to
determine the max_priority and the parent could have been in a lower
priority when it was spawned. To prevent a CPU intensive process from
hawking the CPU by continuously forking children that get scheduled
in the max_priority, the scheduler should determine in which queue
the parent is currently scheduled, and schedule the child in that
same queue.

Other fixes: The USER_Q in kernel/proc.h was incorrectly defined as
NR_SCHED_QUEUES/2. That results in a "off by one" error when
converting priority->nice->priority for nice=0. This also had the
side effect that if someone were to set the MAX_USER_Q to something
else than 0, then USER_Q would be off.
2010-05-18 13:39:04 +00:00
..
a.out.h a.out.h typo (Bug#398, reported by 7shi) 2010-02-07 12:01:37 +00:00
bitmap.h Fixed brackets in bitmap macros 2010-03-30 08:34:33 +00:00
callnr.h New RS and new signal handling for system processes. 2010-03-17 01:15:29 +00:00
cdrom.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
com.h Scheduling server (by Bjorn Swift) 2010-05-18 13:39:04 +00:00
compiler-ack.h cdecl calling convention requires to push arguments on the stack in a 2010-03-30 09:36:46 +00:00
compiler.h cdecl calling convention requires to push arguments on the stack in a 2010-03-30 09:36:46 +00:00
config.h Bump version number to 3.1.7 2010-02-17 12:51:26 +00:00
const.h Intermediate boot verbosity level EXTRA (2), MAX moved to 3 2010-05-10 18:07:59 +00:00
cpufeature.h cpufeature() - rename _SSEx and correct logic in cpufeature() in lib 2010-04-29 19:08:49 +00:00
crtso.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
debug.h - VM_KERN_NOPAGEZERO feature is gone 2009-09-21 14:23:10 +00:00
devio.h Remove U16_t and most other similar types. Rewrite functions to ansi-style 2010-04-21 11:05:22 +00:00
dir.h Changes to the include files in order to make cross-compilation possible. 2009-11-06 08:46:22 +00:00
dirent.h Changes to the include files in order to make cross-compilation possible. 2009-11-06 08:46:22 +00:00
dl_eth.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
dmap.h Driver mapping refactory. 2010-04-09 21:56:44 +00:00
driver.h Use of all NIL_* defines converted to NULL 2010-05-10 13:26:00 +00:00
drivers.h Convert drivers/ and servers/ over to bsdmake 2010-03-22 21:25:22 +00:00
drvlib.h Convert drivers/ and servers/ over to bsdmake 2010-03-22 21:25:22 +00:00
ds.h Driver refactory for live update and crash recovery. 2010-04-08 13:41:35 +00:00
endpoint.h Mostly a revert of r5306. com.h defines MAX_NR_TASKS value which replaces 2009-09-29 20:13:41 +00:00
fslib.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
ioctl.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
ipc.h IPC status code for receive(). 2010-03-23 00:09:11 +00:00
ipcconst.h A reliable way for userspace to check if a msg is from kernel 2010-03-29 11:25:01 +00:00
keymap.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
minlib.h More const correctness. 2010-03-23 14:25:09 +00:00
mq.h Driver refactory for live update and crash recovery. 2010-04-08 13:41:35 +00:00
netdriver.h Driver refactory for live update and crash recovery. 2010-04-08 13:41:35 +00:00
partition.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
paths.h Drivers and servers are simply known as services. 2009-12-17 01:53:26 +00:00
portio.h Remove U16_t and most other similar types. Rewrite functions to ansi-style 2010-04-21 11:05:22 +00:00
profile.h Changes to the include files in order to make cross-compilation possible. 2009-11-06 08:46:22 +00:00
queryparam.h Added paramvalue to the library. 2005-11-08 13:59:27 +00:00
rs.h Unified crash recovery and live update. 2010-04-27 11:17:30 +00:00
safecopies.h New RS and new signal handling for system processes. 2010-03-17 01:15:29 +00:00
sef.h Unified crash recovery and live update. 2010-04-27 11:17:30 +00:00
sound.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
sys_config.h Throw out obsolete Atari, Macintosh and Sun code to un-break packages; 2010-02-16 19:19:42 +00:00
sysinfo.h Add 'getidle' CPU utilization measurement infrastructure 2009-12-02 11:52:26 +00:00
syslib.h kernel/vm: change pde table info from single buffer to explicit per-process. 2010-05-12 08:31:05 +00:00
sysutil.h Add syslib function to obtain CPU frequency 2010-05-03 19:41:04 +00:00
tty.h Changes to the include files in order to make cross-compilation possible. 2009-11-06 08:46:22 +00:00
type.h Include directory reorg and makefile updates. 2010-03-08 11:04:59 +00:00
types.h Remove U16_t and most other similar types. Rewrite functions to ansi-style 2010-04-21 11:05:22 +00:00
u64.h Full 64-bit multitplication and division added to u64 library 2010-05-17 16:44:26 +00:00
vfsif.h - Fix dangling symlink regression 2010-01-21 09:32:15 +00:00
vm.h secondary cache feature in vm. 2010-05-05 11:35:04 +00:00