Presentation is loading. Please wait.

Presentation is loading. Please wait.

Integrated Control and Scheduling James Yang, Steve Sheng, Bill Li Instructor: Prof. Insup Lee.

Similar presentations


Presentation on theme: "Integrated Control and Scheduling James Yang, Steve Sheng, Bill Li Instructor: Prof. Insup Lee."— Presentation transcript:

1 Integrated Control and Scheduling James Yang, Steve Sheng, Bill Li Instructor: Prof. Insup Lee

2 Outline Motivation Periodic scheduling Control Concepts Robust scheduling

3 Motivation Misunderstanding between control and scheduling communities –C: computer platforms provide deterministic, fixed sampling period –S: control tasks have: fixed periods hard deadlines known worst-case execution times (WCETs)

4 The Vision Dynamic, flexible, interactive integrated control and scheduling environment –Control performance vs. computing resource –Relax known WCET On-line information exchange –Desired period of control task –Nominal execution time –Desired deadline

5 Delete,Real-Time Scheduling Concept about task –Periodic, sporadic, aperiodic –Worst case CPU time C, deadline D Scheduling of CPU time for periodic tasks –Static cyclic executive scheduling Off-line to generate execution table –Priority-based scheduling Assumption: Di=Ti, no communication, ideal kernel Earliest deadline first(EDF) Rate-monotonic(RM)

6 Periodic Task Scheduling EDF –If U<=1, then all deadlines will be met –Processor fully utilized with deadlines met RM –Tasks with shorter period get higher priority –If U<=n(2^1/n-1) –Iff Ri<Di for all tasks –Bad performance when Di<<Ti

7 Implementation and Scheduling of Periodic Control Loops What is control loop? –Three parts: data collection, algorithm computation, output transmission –Periodical in most cases Implementation –Single-task approach –Multiple-task approach

8 Loop Timing Constrains The period should be constant Input-output latency –Decrease stability, limits performance –Ignore if minimized, otherwise be considered samplecontrolsamplecontrol period latency

9 Single-task Implementation LOOP Await clock interrupt Data collection Algorithm calculation Output transmission END CurrentTime(t) LOOP Data collection Algorithm calculation Output transmission t = t+h WaitUntil(t) END

10 Control Delay Separate algorithm calculation –Calculate output: make use of current sample information –Update state: update controller states CurrentTime(t) LOOP Data collection calculate output Output transmission update state t = t+h WaitUntil(t) END

11 Timing Requirement Data collection: same instant every period Calculate output: ASA sample available Output transmission: immediately after CO, or at fixed instant after data collection Update state: before next period, or before release of next “calculate output”

12 Scheduling of Control Tasks Fixed-priority scheduling –Describe controller as period tasks –Rate-monotonic is optimal if D=T –Deadline-monotonic is optimal if D<=T, used to improve important long period control tasks

13 Deadline Assignment Period T and execution time C are known Deadlines D must be assigned, optimal deadline assignment is NP-hard Effective-deadline-monotonic assignment –Later subtasks given just enough time Dij=Di-Sum[j+1<=k<=ni]Cik

14 Scheduling Under Overload Conditions Relaxation of known worst-case execution time –Treat longer-than-worst actual execution time as overload conditions –Algorithm: associate positive value with task Complete the most important tasks Avoid domino effect

15 Robust Aperiodic Scheduling Real-time systems should handle –Periodic tasks Hard deadlines –Aperiodic tasks—irregular arrival times Soft deadlines –minimize average response time Firm deadlines –Reject tasks going to be late –Maximize completed tasks –Maximize system value

16 Assumptions All periodic tasks have hard deadlines, known constant period and WCET Arrival time of aperiodic tasks is unknown WCET of aperiodicities is known on arrival Aperiodicities have firm deadlines and can be rejected

17 Terminology J: a set of aperiodic Ji ordered by deadline ri:arrival time of Ji Ci:max computation time of Ji Ci’:actual computation time of Ji di:deadline of Ji mi:deadline tolerance vi:task value(relative importance) fi:finishing time Ei:exceeding time

18 Total Bandwidth Algorithm Assign a suitable deadline –dk=max(rk, dk-1)+Ck/Us –d0=0 Schedule it as periodic tasks

19 TB Algorithm: Example

20 Resource Reclaiming TB behavior depends on est. max time –What if the value is overestimated? Correct the assigned deadlines –di=ri’+Ci/Us –ri’=max(ri, d’i-1, fi-1) –At task completion, di’=ri’+Ci’/US

21 Resource Reclaiming: example

22 Schedulability Theorem: given a set n of periodic tasks with Up and a TB server with Us, the whole set is schedulable iff Up+Us<=1 Lemma: in [t1,t2], if Cape is the total execution time of aperiodic tasks, then Cape<=(t2-t1)Us

23 Robust Scheduling What if overload? –Assign large bandwidth to server –Introduce overload awareness RED algorithm


Download ppt "Integrated Control and Scheduling James Yang, Steve Sheng, Bill Li Instructor: Prof. Insup Lee."

Similar presentations


Ads by Google