3 anyhigher, anyready, hzsched, procpriority, procrestore, procsave, scheddump, schedinit, sched, yield
4 \– scheduler interactions
6 .ta \w'\fLchar* 'u +10n +8n +8n
11 void procpriority(Proc *p, int priority, int fixed)
12 void procrestore(Proc *p)
13 void procsave(Proc *p)
14 void procwired(Proc *p, int machno)
22 Npriq = 20, /* scheduler priority levels */
23 PriNormal = 10, /* base for normal processes */
24 PriKproc = 13, /* base for kernel processes */
25 PriRoot = 13, /* base for root processes */
30 These functions define the priority process scheduler's interface.
31 Processes are scheduled strictly by priority, and processor affinity.
32 When possible, processes with no affinity will be rescheduled on the
33 same processor. Within a priority, scheduling is round–robin.
34 Long–running processes of the same priority are preempted and
35 rescheduled. But cpu use (or lack thereof) may adjust the priority up
36 or down, unless it has been explicitly fixed. Kernel processes are
39 while user processes start with
43 returns true if any higher priority processes are runnable, while
45 returns true if any processes are runnable at all.
47 gives up the processor and pretends to consume ½ clock tick, while
49 invokes the scheduler, potentially recursively.
51 may be called outside process context. Either may return immediately.
53 initializes scheduling on the running processor.
56 sets a process' priority directly. Fixed–priority processes are not
57 reprioritized based on cpu use.
59 makes a process runnable only on a single processor.
62 is called by the clock routine on every tick to collect statistics.
63 Periodically (typically once a second)
65 reprioritizes based on cpu use.
70 are architecture–dependent routines used by the scheduler to save and
73 prints scheduler statistics.
75 .B /sys/src/9/port/proc.c
82 .B /sys/src/9/*/main.c
84 .B /sys/src/9/*/arch.c
86 .B /sys/src/9/*/trap.c