Scheduling Flashcards

(53 cards)

1
Q

when do scheduling decisions happen?

A

transitions to ready, waiting, terminated
non-preemptive on waiting/terminated only

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

goals of a scheduling algorithm

A

high throughput
low turnaround time
low response time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what’s throughput

A

of processes that finish per unit time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what’s turnaround time

A

length of time it takes for a process to finish

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what’s response time

A

length of time between request and first response

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what are the factors controlling throughput?

A

cpu/io device utilization

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what controls turnaround/response time?

A

waiting time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what’s cpu utilization?

A

fraction of time CPU does productive work

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what’s waiting time?

A

time each process waits in the ready queue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

FCFS convoy effect?

A

a job with a long CPU burst prevents many shorter jobs after it from running

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is a consequence of the FCFS convoy effect?

A

no IO requests are issued, so there is poor IO device utilization

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

SJF

A

estimate the next CPU burst and run the process with the shortest one

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what’s SRTF?

A

preemptive SJF scheme: if a process arrives with a shorter burst than the remaining current time, preempt the current process and run the new one

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what does SJF optimize?

A

minimum average waiting time
minimum response time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

disadvantage of SJF?

A

starves jobs with longer burst times
does not minimize avg turnaround time (long job of short bursts)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what’s RR?

A

pick a quantum and preempt processes that run for longer, moving to the back of a FIFO queue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

advantages of RR?

A

fair allocation of CPU across all jobs
low avg waiting time w/ varying lengths
short jobs finish quickly
good responsiveness with few jobs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

disadvantages of RR?

A

does worse than FCFS for same-sized jobs
context switch costs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

direct costs of a context switch?

A

save/restore registers for syscall
switch address spaces i.e. page table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

indirect costs of a context switch?

A

more misses in cache, TLB, file system’s buffer cache

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

what condition on the quantum minimizes avg turnaround time?

A

quantum geq most process times

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

what’s priority scheduling?

A

give each process a priority and run the highest priority process

23
Q

what’s aging?

A

increasing the priority of a process as it waits to prevent starvation

24
Q

what’s a multilevel feedback queue?

A

32 queues, run the highest priority queue with RR within each queue

25
load calculation?
avg length of run queue + short term sleep queue over last minute
26
if load is high...
priorities decay more slowly
27
if p_nice low (like -20)
priority decays more quickly
28
how to update p_estcpu for a sleeping process?
track sleep time and approximate decay ignoring p_nice and past loads
29
what's affinity scheduling?
trying to keep threads on the same core prevent load imbalance: cost benefit analysis when switching
30
what's priority inversion?
a lower priority thread blocks a higher priority thread (e.g. L holds a mutex that H wants)
31
BVT runs...
the process with the lowest effective virtual time
32
context switch allowance motivation
too many context switches degrades performance
33
context switch allowance
run threads for C/w_i before preempting
34
SVT motivation
if a sleeping process wakes up, its A_i is low and starves other processes
35
A_i set to _ after _
A_i = max{A_i, SVT} after waking up from voluntary sleep
36
what's the SVT defined as?
SVT = min{A_j} across all processes
37
why do we not SVT after involuntary sleep?
a faulting process needs a chance to catch up
38
what is a soft realtime thread?
a thread that must run every so often or performance degrades
39
warp factor calc?
E_i = A_i - (warp_i ? W_i : 0)
40
how do we prevent a buggy warped process from hogging?
L_i limits CPU time, sets warp_i to false if exceeded
41
what is U_i?
L_i gets reset every U_i time
42
lottery scheduling scheme
expected allocation of resources \propto # of tickets
43
tickets encapsulate resource rights that are
abstract, relative, uniform
44
ticket transfers are
explicit transfers of tickets from one client to another, used when a client blocks due a dependency
45
ticket inflation is
an alternative to ticket transfers, a client can escalate its resource rights by creating more tickets
46
ticket inflation should only be used
between mutually trusting clients
47
a currency
denotes a group of mutually trusting clients inflation is locally contained within a currency
48
compensation tickets
are granted to clients that only consume a fraction of their allocated resource quantum
49
5.1 fairness
except 10:1, observed ratios are close to allocations greater variance with larger ratios, but still converge over longer time intervals
50
5.2 flexible control
dynamically adjust ticket value allows parallel monte carlo simulations to quickly reach an approximate answer
51
5.3 client-server
ticket allocations affect response time and throughput
52
5.4 multimedia
control quality of multiple video servers distorted by X11's RR processing frame rates were close to allocated with -nodisplay
53
5.6 system overhead
tree-based lottery only generates a random number and performs lg n additions/comparisons to select a winner among n clients