Linux_Scheduling Flashcards

1
Q

Prior to kernel version 2.5, the Linux kernel ran a variation of the traditional ….?

A

UNIX scheduling algorithm.

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

Two problems with the traditional UNIX scheduler are…?

A

that it does not provide adequate support for SMP systems and that it does not scale well as the number of tasks on the system grows.

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

With Version 2.5, the scheduler was overhauled, and the kernel now provides a scheduling algorithm that runs in…?

A

constant time—known as O(1)—regardless of the number of tasks on the system.

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

The newer scheduler also provides increased support for..?

A

SMP, including processor affinity and load balancing, as well as providing fairness and support for interactive tasks.

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

The Linux scheduler is a pre-emptive, priority-based algorithm with two separate priority ranges:

A

a real-time range from 0 to 99 and a nice value ranging from 100 to 140. These two ranges map into a global priority scheme wherein numerically lower values indicate higher priorities.

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

Unlike schedulers for many other systems, including Solaris and Windows XP, Linux assigns…?

A

higher-priority tasks longer time quanta and lower-priority tasks shorter time quanta. The relationship between priorities and time-slice length.

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

A runnable task is considered eligible for execution on the CPU as long as it has…?

A

time remaining in its time slice.

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

When a task has exhausted its time slice, it is considered…?

A

expired and is not eligible for execution again until all other tasks have also exhausted their time quanta.

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

The kernel maintains a list of all runnable tasks in a …?

A

run queue data structure.

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

Because of its support for SMP, each processor maintains its own run…?

A

queue and schedules itself independently.

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

Each run queue contains two priority arrays…?

A

active and expired.

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

The active array contains all tasks with

A

time remaining in their time slices, and the expired array contains all expired tasks.

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

Each of these priority arrays contains a list of tasks indexed according to…?

A

priority.

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

The scheduler chooses the task with the…?

A

highest priority from the active array for execution on the CPU.

(On multiprocessor machines, this means that each processor is scheduling the highest-priority task from its own run queue structure. )

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

all tasks have exhausted their time slices (that is, the active array is empty), the…?

A

two priority arrays are exchanged; the expired arrya becomes the active array, and vice versa.

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

Linux implements real-time scheduling as defined by…?

A

POSIX.1b, which is described in Section 5.4.2.

17
Q

Real-time tasks are assigned…?

A

static proprieties.

18
Q

All other tasks have dynamic priorities that are based on their…?

A

nice values plus or minus the value 5.

19
Q

The interactivity of a task determines whether the value 5 will be…?

A

added to or subtracted from the nice value.

20
Q

A task’s interactivity is determined by how long it has been…?

A

been sleeping while waiting for I/O.

21
Q

Tasks that are more interactive typically have longer sleep times and therefore are more likely to have …?

A

adjustments closer to −5, as the scheduler favours interactive tasks.

(The result of such adjustments will be higher priorities for these tasks.)

22
Q

Conversely, tasks with shorter sleep times are often more CPU-bound and thus will have…?

A

their priorities lowered.

23
Q

A task’s dynamic priority is recalculated when the task has exhausted its…?

A

time quantum and is to be moved to the expired array. Thus, when the two arrays are exchanged, all tasks in the new active array have been assigned new priorities and corresponding time slices.