Parametric Optimization Of Some Critical Operating System
Download
Report
Transcript Parametric Optimization Of Some Critical Operating System
Parametric Optimization Of Some
Critical Operating System Functions
An Alternative Approach To The Study
Of Operating Systems Design
Parametric Optimization
An Alternative Approach of OS Study
Some Critical Operating System Functions
CPU
Scheduling
study
parameter performance
relationships
achieve
parametric optimization
using simulation technique
Synchronization
and
Deadlock Handling
Memory
Management
Disc
Scheduling
…
…
…
…
…
…
The Integrated Perspective
CPU Scheduling
An Introduction
An operating system must select processes for
execution in some fashion.
CPU scheduling deals with the problem of
deciding which of the processes in the ready
queue is to be allocated the CPU.
The selection process is carried out by an
appropriate scheduling algorithm (in our
simulation we have used the multilevel feedback
queue).
CPU Scheduling
Parameters Involved
Round Robin Queue Time Slot
FIFO, Priority and SJF Queue Aging
Thresholds
Preemptive vs. Non-Preemptive Scheduling
(2 switches in priority and SJF queues)
Context Switching Time
-values and initial execution time estimates
CPU Scheduling
Performance Measures
Average Turnaround Time
Average Waiting Time
CPU utilization
CPU throughput
CPU Scheduling
Parameter-Performance Relationships
Effect of Round Robin Time Slot:
Small round robin quantum value lowers system
performance with increased context switching time.
Large quantum values result in FIFO behavior with
effective CPU utilization, lower turnaround and waiting
times as also the potential of starvation.
Effect of Aging Thresholds:
A very large value of aging thresholds makes the waiting
and turnaround times unacceptable. These are signs of
processes nearing starvation.
On the other hand, a very small value makes it equivalent
to one round robin queue.
CPU Scheduling
Implementation Details
Some specifications of the implemented module:
The scheduler consists of 4 linear Q's: The first Q is FIFO, second Q
is priority-based, third Q is SJF.and the fourth (highest Priority) is
round robin.
A switch provides choice between pre-emptive and non pre-emptive
scheduling in the SJF, and priority-based Q's.
Jobs cannot execute in a Q unless there are no jobs in higher priority
Q's.
Some variable parameters:
Feed back occurs through aging, aging parameters differ, i.e., each Q
has a different aging threshold
The time slot for the Round Robin Q
Context switching time
CPU Scheduling
Implementation Details (contd.)
The jobs are created with the following fields in their PCB: Job
number, arrival time, actual execution time, priority,Queue number
(process type 1 - 4). The creation is done randomly.
Output indicates a time line, i.e, every time step, it indicates which
processes are created (if any), which ones are completed (if any),
processes which aged in different Q's, etc.
The eventual goal is to optimize several performance measures
(enlisted earlier)
CPU Scheduling
Sample Screenshot of Simulation
Sample Run 1:
Round Robin Q Time slot: 2
CPU Scheduling
Sample tabulated data from simulation
Av.Turnaround
Time
Av. Waiting
Time
CPU
Utilization
Throughput
2
19.75
17
66.67 %
0.026
3
22.67
20
75.19 %
0.023
4
43.67
41
80.00 %
0.024
5
26.5
25
83.33 %
0.017
6
38.5
37
86.21 %
0.017
RRTimeSlot
CPU Scheduling
Sample Graphs(using data from simulation)
RRTimeSlot vs. Average Waiting
Time
RRTimeSlot vs. Average
Turnaround Time
50
RRTim eSlot
Av.Turnaround
Tim e
0
50
RRTim eSlot
0
Av. Waiting
Tim e
RRTimeSlot vs. CPU Utilization
100
RRTim eSlot
50
0
CPU
Utilization
CPU Scheduling
Conclusions from the sample simulation
The following emerged as the optimizing
parameters for the given process mix:
optimal value of the round robin quantum
smallest possible context switching time
update had no effect on the performance
measures in this case
Parametric Optimization
Advantages of this approach
Presents operating systems design in a
generic and objective manner
Students learn the scientific technique of
parametric optimization which can be easily
applied to other engineering problems
Students can simulate the modules using a
programming language of their choice on a
platform of their choice.