RTS Lecture 5 1644659257626

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 26

BITS Pilani

presentation
BITS Pilani Pawan Gupta
Pilani Campus
BITS Pilani
Pilani Campus

SS ZG553, Real Time Systems


Lecture No 5.
Task Allocation and Scheduli
ng
 
How to assign tasks to processors and to schedule them
in such a way that deadlines are met
• Our focus today: Multiprocessor task scheduling

BITS Pilani, Pilani Campus


Task Assignment to
Multiprocessor Scheduling
Algorithm for Task Assignment to Processors of a Multiprocessor.
The Task Assignment can be done using various Algorithms
Utilization Balancing Algorithm: This Algorithm assigns tasks
to processors one by one in such a way that at the end of each
step, the utilizations of the various processors are nearly as
balanced as possible. Tasks are assumed to be preemptable
Next Fit Algorithm: The Next fit Algorithm is designed to work in
conjunction with the Rate Monotonic Algorithm.
Divides Set of Tasks into classes. Tasks are assumed to be
preemptable. A set of processors is assigned exclusively to
particular task class

BITS Pilani, Pilani Campus


Task Assignment to
Multiprocessor Scheduling

Bin Packing Algorithm: Assigns tasks to processors under


the constraint that total processor utilization do not
exceed a given threshold. The threshold is set in such a
way that the uniprocessor scheduling algorithm is able to
schedule the tasks assigned to each processor. Tasks
are assumed to be preemptive
Myopic offline Scheduling Algorithm: The algorithm can
deal with non-preemtpive tasks.It build up the schedule
using a search process

BITS Pilani, Pilani Campus


Task Assignment to
Multiprocessor Scheduling

Focused addressing and Bidding Algorithm: Tasks are


assumed to arrive at individual processors. A processor
that do finds itself unable to meet the deadline or other
constraints of all its tasks tries to offload some of its
workload onto other processors. It does so by announcing
the task to be offloaded to other processor and waiting for
other processors to offer to take them up
Buddy Strategy: Similar to Focussed approach but
Processors are divided into 3 categories:
Underload, Fully Loaded and Overloaded
Overloaded processors asks Underloaded ones to take some
of their loads

BITS Pilani, Pilani Campus


Task Assignment to
Multiprocessor Scheduling

Assignment with Precedence Constraints:


This take Task Precedence Constraint into account. It does
so using Trial and Error Process that tries to assign tasks
that communicate heavily with one another to the same
processor so that communication cost can be minimized

BITS Pilani, Pilani Campus


Critical Section

Certain Anomalous Behavior can be Exhibited due to


critical sections:
A lower priority task can make a high priority task wait for
its finish even if two are not competing for access to the
same critical section
Algorithm to provide upper bound to the period during
which a lower priority task can block a higher priority task

BITS Pilani, Pilani Campus


Mode Changes

Frequently task sets change during the operation of a real


time system
Mission can have multiple phases and each phase is
characterized by a different set of tasks or the same task
set but with different priorities or arrival rates
Algorithm for scheduling issues that arise with mission
phase changes and how to delete or add tasks to task
list

BITS Pilani, Pilani Campus


Fault Tolerant Scheduling

The challenge of ensuring that deadline will continue to be


met despite occurrence of faults
Algorithm that schedules backups that are activated in the
event of failure

BITS Pilani, Pilani Campus


Dynamic Fault Tolerant
Scheduling
This algorithm uses task criticality which is based on
"utilization" and "time of resource allocation". Task
utilization is used to dynamically select the type of fault
recovery method in order to tolerate the maximum number
of faults. Based on the task criticality parameters, task is
categorized into critical and non-critical. Critical tasks will
be replicated on separate cores to increase the probability
of on time task completion in faulty condition. Non critical
tasks are scheduled on a single core and check pointing
with rollback recovery fault tolerant technique is applied on
them. The scheduling feasibility rate of the DFTS algorithm
is higher than other fault tolerant scheduling methods.

BITS Pilani, Pilani Campus


Fault-Tolerant Scheduling
Based On Task Criticality
Selects a suitable fault tolerance technique assignment for
each task when the resources for the task are available.
During scheduling it is to be taken care that no tasks will be
scheduled until all other tasks with higher priorities are
scheduled and the previously occurred faults in the
system are tolerated.
The scheduler calculates the criticality threshold for the
task which is present at the first position of the ready list
as soon as ideal core is available in the system.

BITS Pilani, Pilani Campus


Real-Time Operating Systems

Support process management and synchronization,


memory management, interprocess communication,
and I/O.
Three categories of real-time operating systems:
small, proprietary kernels.
e.g. VRTX32, pSOS, VxWorks
real-time extensions to commercial timesharing operatin
systems.
e.g. RT-Linux, RT-NT
research kernels
e.g. MARS, ARTS, Spring, Polis

13
BITS Pilani, Pilani Campus
Real-Time Applications Spectrum

Hard Real-Time VxWorks, Lynx, QNX, ...


Operating
Intime, HyperKernel, RTX
System
Windows CE

General-Purpose
Operating
System Windows NT
Soft

14
BITS Pilani, Pilani Campus
Embedded (Commercial)
Kernels
Stripped down and optimized versions of timesharing
operating systems.
Intended to be fast
– a fast context switch,
– external interrupts recognized quickly
– the ability to lock code and data in memory
– special sequential files that can accumulate data at a fast rate

To deal with timing requirements


– a real-time clock with special alarms and timeouts
– bounded execution time for most primitives
– real-time queuing disciplines such as earliest deadline first,
– primitives to delay/suspend/resume execution
– priority-driven best-effort scheduling mechanism or a table-driven mechanism.
Communication and synchronization via mailboxes, events, signals, and
semaphores.

15
BITS Pilani, Pilani Campus
Real-Time Extensions to
General Purpose Operating Systems
E.g., extending LINUX to RT-LINUX, NT to
RT-NT
Advantage:
– based on a set of familiar interfaces
(standards) that speed development and
facilitate portability.
Disadvantages
– Too many basic and inappropriate underlying
assumptions still exist.

16
BITS Pilani, Pilani Campus
Using
General Purpose Operating Systems

GPOS offer some capabilities useful for real-time


system builders

RT applications can obtain leverage from existing


development tools and applications

Some GPOSs accepted as de-facto standards for


industrial applications

17
BITS Pilani, Pilani Campus
Real Time Linux approaches

1. Modify the current Linux kernel to handle


RT constraints
– Used by KURT

2. Make the standard Linux kernel run as a


task of the real-time kernel
– Used by RT-Linux, RTAI

18
BITS Pilani, Pilani Campus
Modifying Linux kernel
Advantages
– Most problems, such as interrupt handling,
already solved
– Less initial labor
Disadvantages
– No guaranteed performance
– RT tasks don’t always have precedence over
non-RT tasks.

19
BITS Pilani, Pilani Campus
Running Linux as a process of a second RT
kernel

•Advantages
Can make hard real time guarantees
Easy to implement a new scheduler
•Disadvantages
Initial port difficult, must know a lot about underlying hardware
Running a small real-time executive is not a substitute for a full-fledged RTOS

20
BITS Pilani, Pilani Campus
GPOS -- for RT applications?
Scheduling and priorities
– Preemptive, priority-based scheduling
– non-degradable priorities
– priority adjustment

– No priority inheritance
– No priority tracking
– Limited number of priorities
– No explicit support for guaranteeing timing constraints

21
BITS Pilani, Pilani Campus
GPOS -- for RT applications?
(contd.)
Quick recognition of external events
– Priority inversion due to Deferred Procedure Calls (DPC)

I/O management
Timers granularity and accuracy
– High resolution counter with resolution of 0.8 sec.
– Periodic and one shot timers with resolution of 1 msec.

Rich set of synchronization objects and communication


mechanisms.
– Object queues are FIFO

22
BITS Pilani, Pilani Campus
Research Operating Systems

MARS – static scheduling


ARTS – static priority scheduling
Spring –dynamic guarantees

23
BITS Pilani, Pilani Campus
MARS

Offers support for controlling a distributed application based


entirely on time events (rather than asynchronous events)
from the environment.
A priori static analysis to demonstrate that all the timing
requirements are met.
Uses flow control} on the maximum number of events that the
system handles.
Based on the time driven model -- assume everything is periodic.
Static table-driven scheduling approach
A hardware based clock synchronization algorithm
A TDMA-like protocol to guarantee timely message delivery

24
BITS Pilani, Pilani Campus
ARTS -- CMU (Tokuda, et al)
The ARTS kernel provides a distributed real-time computing
environment.
Works in conjunction with the static priority driven preemptive
scheduling paradigm.
Kernel is tied to various tools that a priori analyze
schedulability.
The kernel supports the notion of real-time objects and real-
time threads.
Each real-time object is time encapsulated -- a time fence
mechanism:The time fence provides a run time check that
ensures that the slack time is greater than the worst case
execution time for an object invocation

25
BITS Pilani, Pilani Campus
SPRING – Umass. (Ramamritham &
Stankovic)
Real-time support for multiprocessors and distributed sys
Strives for a more flexible combination of off-line and on-
line techniques
– Safety-critical tasks are dealt with via static table-driven scheduling.
– Dynamic planning based scheduling of tasks that arrive dynamically.

Takes tasks' time and resource constraints into account


and avoids the need to a priori compute worst case
blocking times
Reflective kernel retains a significant amount of application
semantics at run time – provides flexibility and graceful
degradation.

26
BITS Pilani, Pilani Campus

You might also like