Sunday, July 02, 2006

adam's home

adam's home

* Static priority:

[100, 139) - Nice: [-20, 19)

* Base Time Slice - depends on static priority (5ms - 800ms). By default 100 ms.

* Dynamic priority:

dynamic priority (100 - 139) - depends on static priority, and bonus (0 - 10) - actually
used to select the new process to run.

Bunus depends on Average Sleep Time

* The run queue data structure:
a. Per-CPU

struct runqueue
prio_array_t * active;
prio_array_t * expired;

typedef struct list_head[NR_PRIO] prio_array_t;

* scheduler_tic() function:

Call in each timer tick, update the time slice of "Current" task.

For task run out of time slice - normal process, moved to expire queue, - real-time, move to
tail of priority list in active queue.

* schedule()

Select the next task to run, do context swith

a) Direct invocation - when a task want's to go asleep
b) lazy invocation - set TIF_NEED_RESCHED flag of "Current". Checked when returnning to user mode

1 comment:

liyi said...

SCHED_RR time slice is change by changing the static priority (nice(), sched_setpriority()).

Blog Archive