minix/include
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
..
arch kernel/vm: change pde table info from single buffer to explicit per-process. 2010-05-12 08:31:05 +00:00
arpa create the getaddrinfo and getnameinfo library functions and friends 2010-01-21 06:38:17 +00:00
minix Scheduling server (by Bjorn Swift) 2010-05-18 13:39:04 +00:00
net Remove U16_t and most other similar types. Rewrite functions to ansi-style 2010-04-21 11:05:22 +00:00
netinet typo 2010-01-25 21:06:07 +00:00
sys This patch switches the MINIX3 ethernet driver stack from a port-based 2010-05-17 22:22:53 +00:00
a.out.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
alloca.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
ansi.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
ar.h Import NetBSD's make 2010-02-04 16:52:54 +00:00
assert.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
configfile.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
ctype.h isblank() implementation. 2010-04-08 15:00:25 +00:00
curses.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
dirent.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
env.h . made memory parsing function into a library call 2007-02-16 15:54:28 +00:00
err.h Add getopt_long library function 2010-01-25 18:11:21 +00:00
errno.h New RS and new signal handling for system processes. 2010-03-17 01:15:29 +00:00
fcntl.h Remove the types Dev_t, _mnx_Gui, _mnx_Uid, and similar. 2010-04-13 10:58:41 +00:00
fenv.h Floating point support functions 2009-12-24 20:22:41 +00:00
float.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
fnmatch.h - new pread(), fnmatch() calls 2010-02-25 17:08:08 +00:00
fts.h Some misc portability-enhancing definitions. 2006-01-20 13:42:29 +00:00
getopt.h Add getopt_long library function 2010-01-25 18:11:21 +00:00
glob.h A glob() implementation. 2008-04-08 13:14:33 +00:00
grp.h Remove the types Dev_t, _mnx_Gui, _mnx_Uid, and similar. 2010-04-13 10:58:41 +00:00
ifaddrs.h . getifaddrs() and data 2006-04-03 15:06:31 +00:00
inttypes.h Additions to inttypes.h format strings 2010-01-25 18:16:25 +00:00
lib.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
libgen.h Add dirname function, forgot to commit header before 2010-01-25 18:17:57 +00:00
libutil.h Header file for new -lutil (naming from freebsd) 2005-07-19 16:01:20 +00:00
limits.h Implementations of readv and writev 2010-01-08 13:40:34 +00:00
locale.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
Makefile Add some support for wchar_t. 2010-04-19 15:20:24 +00:00
math.h Add a set of declarations to math.h. Since we don't actually have 2010-03-09 22:05:20 +00:00
mathconst.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
midiparser.h support for OSS. 2009-10-01 16:36:14 +00:00
netdb.h Improved compatibility with other Unix systems. 2005-06-10 15:12:03 +00:00
pwd.h Remove the types Dev_t, _mnx_Gui, _mnx_Uid, and similar. 2010-04-13 10:58:41 +00:00
regex.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
regexp.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
setjmp.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
sgtty.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
signal.h Changed pagefault delivery to VM 2010-04-26 23:21:26 +00:00
stdarg.h cdecl calling convention requires to push arguments on the stack in a 2010-03-30 09:36:46 +00:00
stddef.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
stdint.h Additions to inttypes.h format strings 2010-01-25 18:16:25 +00:00
stdio.h Use _POSIX_SOURCE rather than _MINIX to protect popen, pclose and snprintf 2010-01-18 18:06:43 +00:00
stdlib.h Implementation of strto(u)ll, documentation and tests for strto(u)l(l) 2009-12-09 19:01:38 +00:00
string.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
strings.h Fix compiler warnings for pax 2006-03-24 14:03:25 +00:00
sysexits.h . getifaddrs() and data 2006-04-03 15:06:31 +00:00
syslog.h - VM_KERN_NOPAGEZERO feature is gone 2009-09-21 14:23:10 +00:00
tar.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
termcap.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
termios.h Add scancode reading capability to TTY 2010-04-15 06:55:42 +00:00
time.h Add prototypes for a bunch of time-related functions. Surprisingly, 2010-03-09 22:10:58 +00:00
timers.h Changes to the include files in order to make cross-compilation possible. 2009-11-06 08:46:22 +00:00
tools.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
ttyent.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
ucontext.h - Add support for the ucontext system calls (getcontext, setcontext, 2010-03-12 15:58:41 +00:00
unistd.h Remove the types Dev_t, _mnx_Gui, _mnx_Uid, and similar. 2010-04-13 10:58:41 +00:00
utime.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
utmp.h Removal of the executable flag from files that cannot be executed 2009-11-09 10:26:00 +00:00
wchar.h Forgot to add two new files to SVN. 2010-04-20 07:17:03 +00:00
wctype.h Forgot to add two new files to SVN. 2010-04-20 07:17:03 +00:00