flexible scheduling of software with logical execution time constraints* stefan resmerita and...
TRANSCRIPT
Flexible Scheduling of Software with Logical Execution Time Constraints*
Stefan Resmerita and Patricia DerlerUniversity of Salzburg, Austria
*UC Berkeley, USA
October 14, 2009 2RePP: Flexible Scheduling of LET Software
Introduction
• Scope: Embedded software aplications– Set of periodic tasks with predictable timing behavior
– Preemptive scheduling
– Event-triggered tasks
• Problem: Predictability is achieved by restricting the set of feasible schedules
• Aim: Relax scheduling restrictions while preserving predictability
October 14, 2009 3RePP: Flexible Scheduling of LET Software
The LET Programming Model
• Specification of logical execution times for tasks– Giotto, TDL, HTL, xGiotto, FTOS
• Implementation – Dedicated runtime system
October 14, 2009 4RePP: Flexible Scheduling of LET Software
Main Runtime Operations
1. Update outputs at LET end
2. Invoke task at LET starta) Update inputs
b) Release task for execution
October 14, 2009 5RePP: Flexible Scheduling of LET Software
Scheduling
• High-level: scheduling of operations– Static schedule compiled into a „timing program“
– Platform independent
• Low-level: scheduling of task executions– Platform dependent
– May use any policy (e.g., FPS, EDF)
– Schedulability test uses WCET information
• What if the system is not schedulable?
October 14, 2009 6RePP: Flexible Scheduling of LET Software
Trade-offs
• Increased predictability– Separation of timing from functionality– Separation of reactivity from scheduling
• Platform independence– Portable timing program
• Performance costs– Application performance (response time)– Platform requirements (memory/time)– Processor utilization (idle time)
October 14, 2009 7RePP: Flexible Scheduling of LET Software
This Work
• Provides a methodology for obtaining more flexible high-level schedules
• Keep predictability• Increase processor utilization
• Cost: Portability is reduced– Provide tool support
October 14, 2009 8RePP: Flexible Scheduling of LET Software
Enlarging Scheduling Margins
• Use more information about– Execution times of tasks
– Predictability of inputs
– Low-level scheduling
October 14, 2009 9RePP: Flexible Scheduling of LET Software
Common Task Structures
• Shared memory• Internal dispatching
• Offsets
• Example (Two tasks)– Periods: 4 and 8
– Offsets: 2 and 40 104 86 122
PowerOn 8ms_A 8ms_B 16ms4ms
October 14, 2009 10RePP: Flexible Scheduling of LET Software
Case 1: Reading from Sensors
• Internal port p is connected to a sensor
• The variable p is updated at tLs(T)
• δ(T,p): minimun execution time of T
up to accessing p
• Task T can be started at timetr = tLs(T) – δ(T,p)
October 14, 2009 11RePP: Flexible Scheduling of LET Software
Case 2: Reading from LET-Based Tasks
• Ports p1 and p2 are updated from tasks T1 and T2, respectively, at the end of their LETs
tr =max{tLe(T1) – δ(T,p1), tLe(T2) – δ(T,p2)}
October 14, 2009 12RePP: Flexible Scheduling of LET Software
Modified Operational Requirements
(O1) Update task outputs at LET end
(O2) Update inputs connected to sensors at LET start
(O3) Update input ports connected to LET tasks at the end of the source task‘s LET
(O4) Release task T at time tr tLs(T) such that• No input port connected to a sensor is accessed before
tLs(T)
• Every port that is accessed before tLs(T) has a constant value between the moment of the access and tLs(T)
October 14, 2009 13RePP: Flexible Scheduling of LET Software
Computation of Early Release Times
• Formally:
(1)
October 14, 2009 15RePP: Flexible Scheduling of LET Software
Schedulability
• Assumption:
The system with classical release times is schedulable.
• Question:
Is the system with release margins schedulable?• Answer:
Depends on the underlying scheduling algorithm
October 14, 2009 16RePP: Flexible Scheduling of LET Software
Scheduling with Earliest Deadline First
October 14, 2009 17RePP: Flexible Scheduling of LET Software
Fixed-Priority Scheduling
• Counter-example (T1 has higher priority):
• Conservative solution: use only the minimum margin
Classical case: No missed deadline
Early release of T1 leads to a missed deadline for T2
October 14, 2009 18RePP: Flexible Scheduling of LET Software
Our Approach: Dual-Priority Scheduling
• Assign a dual priority to each LET-based task– All dual priorities are lower than all nominal ones
• A task is scheduled by FPS:– With nominal priority inside its LET
– With dual priority outside its LET
• Effect: a task is executed outside its LET only if the CPU would be otherwise idle!
• DP scheduling is as predictable as FPS
October 14, 2009 19RePP: Flexible Scheduling of LET Software
Mixing Events in
• DPS can be used in systems containing also event-triggered tasks
• Event-triggered tasks are always scheduled with nominal priorities
Theorem 3: If event triggered tasks have lower priorities than LET-based tasks, then their response times remain the same or decrease when using release margins with DPS instead of classical release times with FPS.
October 14, 2009 22RePP: Flexible Scheduling of LET Software
Conclusions
• Approach for relaxed scheduling contraints• Usage of execution time information beyond just
WCET• Employ timing predictability offered by LET to
improve scheduling of the application• Static scheduling, fully automatic• Further work: dynamic scheduling, evaluation