void
sched_rqinit(void)
void
sched_setup(void)
void
sched_cpuattach(struct cpu_info *)
void
sched_tick(struct cpu_info *)
void
sched_schedclock(lwp_t *)
bool
sched_curcpu_runnable_p(void)
lwp_t *
sched_nextlwp(void)
void
sched_enqueue(lwp_t *, bool)
void
sched_dequeue(lwp_t *)
void
sched_nice(struct proc *, int)
void
sched_proc_fork(struct proc *, struct proc *)
void
sched_proc_exit(struct proc *, struct proc *)
void
sched_lwp_fork(lwp_t *)
void
sched_lwp_exit(lwp_t *)
void
sched_setrunnable(lwp_t *)
void
sched_print_runqueue(void (*pr)(const char *, ...))
void
sched_pstats_hook(struct proc *, int)
void
sched_pstats(void *arg)
pri_t
sched_kpri(lwp_t *)
void
resched_cpu(lwp_t *)
void
setrunnable()
void
schedclock(lwp_t *)
void
sched_init(void)
The interface is divided into two parts: A set of functions each scheduler needs to implement and common functions used by all schedulers.
voidsched_cpuattach(, struct cpu_info *)voidsched_rqinit(, void)voidsched_setup(, void)voidsched_enqueue(, lwp_t *, bool)voidsched_dequeue(, lwp_t *)lwp_t *sched_nextlwp(, void)boolsched_curcpu_runnable_p(, void)voidsched_print_runqueue(, void (*pr)(const char *, ...))voidsched_tick(, struct cpu_info *)voidsched_schedclock(, lwp_t *))
in order to handle priority adjustment.
voidsched_nice(, struct proc *, int)voidsched_proc_fork(, struct proc *, struct proc *)).
voidsched_proc_exit(, struct proc *, struct proc *)voidsched_lwp_fork(, lwp_t *)voidsched_lwp_exit(, lwp_t *)voidsched_setrunnable(, lwp_t *)).
voidsched_pstats_hook(, struct proc *, int)).
pri_tsched_kpri(, lwp_t *)voidsched_pstats(, void *)inline voidresched_cpu(, lwp_t *)voidsetrunnable(, lwp_t *)voidschedclock(, lwp_t *)).
voidsched_init(, void))
and call
sched_setup()
to initialize any other scheduler-specific data.
/usr/src.
The
CSF
programming interface is defined within the file
sys/sys/sched.h.
Functions common to all scheduler implementations are in
sys/kern/kern_synch.c.
The traditional 4.4BSD scheduler is implemented in
sys/kern/sched_4bsd.c.