8 - Multi-Level Feedback Queue Flashcards

1
Q

Where was MLFQ first described and by who?

A

In 1962, by Corbato in a Compatible Time-Sharing System, CTSS

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

What two problems does MLFQ address?

A

Optimize turnaround time & minimize response time by making a system feel responsive to interactive users.

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

In what situations does MLFQ work?

A

where jobs have behavioral phases and are predictable

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

Is MLFQ 100% trustworhy?

A

No, it can easily be wrong and drive a system to make worse decisions than they would’ve with no knowledge at all.

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

MLFQ has a number of what type of queues?

A

distinct queues

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

What is each queue assigned?

A

a different priority level

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

How does MLFQ decide which job to run at a given time?

A

uses priorities

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

What if more than one job is on a given queue, meaning they have the same priority?

A

Use round-robin scheduling.

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

How does the MLFQ scheduler set priorities?

first word is a verb

A

Varies the priority of a job based on its observed behavior.

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

How does the MLFQ predict a process’s future behavior?

A

Learns about the process as it runs and uses the history of the job to predict the future behavior.

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

What is allotment?

A

the amount of time a job can spend at a given priority level before the scheduler reduces its priority

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

How does MLFQ try to approximate SJF?

A

It first assumes the job is short, giving it high priority. If the assumption is right, it runs and completes quickly. If the assumption is wrong, it will slowly move down the queues, proving to be a long-running process.

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

What are the three problems with ‘current’ MLFQ?

A

Starvation, Possibility of gaming the scheduler, A program may change its behavior over time.

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

Explain ‘Starvation’.

A

If there are “too many” interactive jobs in the system, they will consume ALL cpu time and long-running jobs will never receive any CPU time.

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

Explain ‘The Possibility of Gaming the Scheduler’.

A

Something sneaky can trick the scheduler into giving you more than your fair share of the resource.

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

An example of a GTS attack.

A

Before the allotment is issued, issue an I/O operation and relinquish the CPU. This allows us to remain in the same queue and gain a higher percentage of CPU time. If done right, a job could nearly monopolize the CPU.

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

Explain ‘A program may have change its behavior over time.’

A

what was CPU bound may transition to a phase of interactivity.

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

What is rule 5?

A

After some time period S, move all the jobs in the system to the topmost queue.

19
Q

What problems does Rule 5 solve?

A

Processes are guaranteed to not starve;
If a CPU-bound job becomes interactive, the scheduler treats it properly once it has received the priority boost

20
Q

How are processes guaranteed to not starve?

job/jobs/service

A

By sitting in the top queue, a job will share the CPU with other H-P jobs in a R-R fashion, and thus eventually receive service

21
Q

What happens if time period S is set too high or too low?

A

If too high, long-running jobs could starve. If too low, interactive jobs may not get a proper share of the CPU.

22
Q

What is Ousterhout’s Law?

A

S values are often left unmodified, and thus we are left to hope that the defaults work well in the field.

23
Q

What should we do if we let a job retain its priority by relinquishing the CPU before its allotment expires?

A

Perform better accounting of the CPU time at each level of the MLFQ

24
Q

What happens once a process has used its allotment?

continuation…

A

Whether in one burst, or many small bursts, it is demoted to the next priority queue.

25
Q

What are things to consider when parameterizing such a scheduler?

A

how many queues should there be?
how big should the time-slice be per queue?
the allotment?
how often should priority be boosted in order to avoid starvation and account for changes in behavior?

26
Q

High-priority queues are usually given what?

A

short time slices, comprised of interactive short jobs

27
Q

What do low-priority queues contain?

mention time slices @ end

A

long-running jobs that are CPU-bound so longer time slices work well.

28
Q

Solaris MLFQ is also known as?

A

Time-sharing scheduling class or TS

29
Q

What does Solaris MLFQ provide?

A

a set of tables that determine exactly how the priority of a process is altered throughout its lifetime, how long each time slice is, how often to boost the priority of a job.

30
Q

What are the default values for Solaris MLFQ?

A

60 queues with slowly increasing time-slice lengths from 20 milliseconds to a few hundred milliseconds and priorities boosted around every second or so.

31
Q

What are the size of the time slices for high-priority queues in Solaris MLFQ?

A

20 milliseconds

32
Q

What are the size of the time slices for low-priority queues in Solaris MLFQ?

A

few hundred milliseconds

33
Q

How does FreeBSD work?

A

Adjusts priorities using mathematical formulae to calculate current priority level of a job, basing it on how much CPU the process has used.

34
Q

In FreeBSD, what does decayed usage provide?

A

the desired priority boost in a different manner

35
Q

What about other Schedulers?

A

Some reserve h-p levels for OS work. Others allow some user advice to help set priorities.

36
Q

What help can user or administrators provide the OS so the OS can make a better decision?

A

hints/advice

37
Q

What do BSD Unix derivatives, Solaris, Windows NT, and subsequent Windows OS use as their base scheduler?

A

a form of MLFQ

38
Q

MLFQ can deliver excellent overall performance for what?

A

short-running interactive jobs

39
Q

MLFQ is fair and makes progress for what?

A

long-running CPU-intensive workloads

40
Q

What is rule 1?

A

If Priority(A) > Priority(B), A runs and B doesn’t.

41
Q

What is rule 2?

A

If Priority(A) = Priority(B), A & B run in R-R fashion, using the time-slice/quantum length of the given queue.

42
Q

What is rule 3?

A

When a job enters the system, it is placed at the highest priority/topmost queue.

43
Q

What is rule 4?

A

Once a job uses up its time allotment at a given level, its priority level is reduced