COP 5641 - Kernel and Device Driver Programming
A New Linux Scheduling Algorithm - Sporadic Server
Affected Code
task_struct fields:
sched_param fields:
- int sched_priority
- int sched_ss_low_priority
- struct timespec sched_ss_repl_period
- struct timespec sched_ss_init_budget
- int sched_ss_max_repl - between [1, {SS_REPL_MAX}], inclusive
POSIX system interface:
View Modifications
Modifications to be made in order to implement a new scheduler (as of Linux 2.6.25)
- Single Unix Specification v3
- create main scheduler file sched_sporadic.c
- implement new instance of struct sched_class called sporadic_sched_class
- link new scheduling class into peer maintained linked list of process schedulers:
- modify include/linux/sched.h to include support for sporadic server (as mandated by POSIX/The Single Unix Specification)
- declare symbolic constant #define SCHED_SPORADIC
- add fields to struct sched_param
- int sched_ss_low_priority
- struct timespec sched_ss_repl_period
- struct timespec sched_ss_init_budget
- int sched_ss_max_repl
- int sched_ss_granularity (tentative - non-standard; entity to be regulated - SCHED_PROCESS for SS or SCHED_THREAD for TSP)
- modify kernel/sched.c to handle SCHED_SPORADIC policy
- map symbolic constant SCHED_SPORADIC to sporadic_sched_class in static void __setscheduler(struct rq *rq, struct task_struct *p, int policy, int prio)
- check for policy SCHED_SPORADIC in int set_setscheduler(struct task_struct *p, int policy, struct sched_param *param)
- modify static void __setscheduler(struct rq *rq, struct task_struct *p, int policy, int prio) to take generic parameter sched_param *param instead of implementation specific parameter int prio
Week 5
Week 6
- init priority, sched_class
- cpu_number (smp_processor_id()), runqueues (cpu_rq(cpu)), maintained on stack (?)
HR-timers
Timekeeping
Links
 |
|
 |