Basics of Real-Time Scheduling - PowerPoint PPT Presentation

About This Presentation
Title:

Basics of Real-Time Scheduling

Description:

Processes are a neat way to handle complex systems ... process interrelate with each other to achieve: synchronization. exchange data. pi. pj ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 29
Provided by: janma3
Category:

less

Transcript and Presenter's Notes

Title: Basics of Real-Time Scheduling


1
Basics of Real-Time Scheduling
  • Jan Madsen
  • Informatics and Mathematical Modelling
  • Technical University of Denmark
  • Richard Petersens Plads, Building 321
  • DK2800 Lyngby, Denmark
  • Jan_at_imm.dtu.dk

2
WAP application
  • Tasks

- send requests to server
- translate data received from server
- render data on display
- operating the users control panel
  • Why?

- logically different operations
- performed at different rates
Need structure and to perform multiple processes
3
Why use multiple processes?
  • Processes introduce structure into the system
    design
  • understand each process independently
  • analyze communication between processes to
    determine system behavior
  • Timing is easier to specify
  • Communication between processes provide test
    points
  • Suitable for team effort

Processes are a neat way to handle complex systems
4
What is a process?
  • A process is a state and a procedure
  • State
  • Running
  • Suspended
  • Deactivated
  • Procedure
  • Sequence of separate steps
  • A process may interact with its surroundings

5
Process execution
6
Process execution
  • Periodic
  • the period is the time between successive
    executions
  • the process rate is the inverse of its period
  • Aperiodic
  • non-periodic process, typical an event handler
  • Sporadic
  • hard real-time aperiodic process
  • usually, a minimum interarrival constraint is
    imposed

7
Example A software processes
  • A process includes
  • code
  • memory which belongs to the process
  • connections to other processes
  • A process is a unique execution of a program
  • In most embedded systems, processes never die!

8
Executing on a single CPU
9
Execution of multiple processes
  • On a single CPU
  • A Pentium processor
  • On a distributed homogeneous system
  • A network of Pentium processors
  • On a distributed heterogeneous system
  • A network of differing processors (CPUs and ASICs)

10
About this lecture
  • Huge literature on scheduling theory
  • Aim is to give an overview of problems and
    possible solutions to the multi-task scheduling
    problem related to RTOS
  • Structure of lecture
  • Some basic concepts and teminology
  • Uni-processor scheduling
  • Rate-monotonic scheduling
  • Earlies-deadlines-first scheduling
  • Multi-processor scheduling

11
PART I Scheduling Terminology and Basic Concepts
12
Design flow
Partitioning/clustering
P1
P2
Allocation
Mapping
P3
Scheduling
Communication
P1
P3
P2
13
Scheduling
14
Terminology
  • Architecture

Application
  • Application
  • Scheduling

Architecture
  • Constraints

15
Architecture
  • Components
  • Processors
  • CPU, DSP, ASIC, ...
  • Communication
  • Bus, network, ...
  • Devices
  • sensor, actuator, display, ...
  • Architecture may be fixed or (re-)configurable

os
device
a
b
c
mem
device
16
Application
  • Task
  • A module which can be envoked to perform a
    particular function
  • A schedulable entity
  • Characterized by its
  • Timing constraints
  • Precedence contraints
  • Exclusion constraints
  • Resource requirements

17
Timing constraints
1
18
Task execution
  • Periodic
  • the period is the time between successive
    executions
  • Aperiodic
  • non-periodic task, typical an event handler
  • Sporadic
  • hard real-time aperiodic task
  • typical, a minimum interarrival constraint is
    imposed

19
Precedence constraints
  • pi precede pj if pi must finish before pj begins
  • process interrelate with each other to achieve
  • synchronization
  • exchange data

pi
pj
20
Exclusion constraints
  • pi exclude pj if no execution of pj is allowed
    between the time that pi starts its computation
    and the time that pi complete its computation
  • Prevent simultaneous access to shared resources
  • data
  • memory
  • devices

pi
pj
21
Resource constraints
  • R r1, r2, , rm
  • Example
  • R(pi) r1, r3 resource r1 and r3 is required
    by pi during its execution
  • may be used to
  • implement a critical section
  • enforce PE assignment of processes

22
Scheduling approaches
  • Classical scheduling theory
  • Uniprocessor systems
  • RMS
  • EDF
  • Distributed real-time scheduling
  • Deterministic (static) scheduling
  • Dynamic scheduling

23
Scheduling
  • Allocation
  • Determine number and type of processors/resources
  • Assignment
  • Binding tasks to processors
  • Scheduling
  • Determine execution order

24
Scheduling principles
  • Off-line
  • A scheduler performing its job before the
    scheduled system is put into operation
  • On-line
  • A scheduler performing its job at run-time, when
    the system is running
  • Typically list-based
  • When a task is released (ready) it is placed in a
    list
  • Scheduler select which task from the list to
    execute next
  • Selection based on some criteria scheduling
    policy

25
Scheduling areas
  • High-level Synthesis
  • fine grained, operation/instruction level
  • schedule done off-line
  • single time constraint
  • Real-time operating systems (RTOS)
  • coarse grained, programs/sub-programs
  • scheduling done on-line
  • multiple time constraints

26
SoC scheduling
  • Similarity to RTOS
  • Time constraints
  • Context switching
  • Task synchronization
  • Task communication
  • Difference to RTOS
  • Large design space
  • Variable granularity
  • Wide range of metrics
  • Time, power, cost, ...
  • Flexibility, reliability, ...
  • High degree of optimization
  • Dedicated hardware

27
Preemption vs. Non-preemption
  • Non-preemptive scheduling
  • Preemptive scheduling

28
Metrics
  • Minimize

Schedule length
Write a Comment
User Comments (0)
About PowerShow.com