scheduling - time quantum in miliseconds

- Currently the cpu time quantum is timer-ticks based. Thus the
  remaining quantum is decreased only if the processes is interrupted
  by a timer tick. As processes block a lot this typically does not
  happen for normal user processes. Also the quantum depends on the
  frequency of the timer.

- This change makes the quantum miliseconds based. Internally the
  miliseconds are translated into cpu cycles. Everytime userspace
  execution is interrupted by kernel the cycles just consumed by the
  current process are deducted from the remaining quantum.

- It makes the quantum system timer frequency independent.

- The boot processes quantum is loosely derived from the tick-based
  quantas and 60Hz timer and subject to future change

- the 64bit arithmetics is a little ugly, will be changes once we have
  compiler support for 64bit integers (soon)
This commit is contained in:
Tomas Hruby
2010-05-25 08:06:14 +00:00
parent ac14a989b3
commit 451a6890d6
17 changed files with 188 additions and 102 deletions

View File

@@ -14,7 +14,7 @@ typedef struct { /* bitmap for system indexes */
struct boot_image {
proc_nr_t proc_nr; /* process number to use */
int flags; /* process flags */
unsigned char quantum; /* quantum (tick count) */
unsigned quantum; /* time quantum in ms */
int priority; /* scheduling priority */
int stksize; /* stack size for tasks */
char proc_name[P_NAME_LEN]; /* name in process table */