Virtual scheduling for compositional real-time guarantees 8th IEEE International Symposium on Industrial Embedded Systems Martijn van den Heuvel, Reinder J. Bril and Johan J. Lukkien System Architecture and Networking (SAN) Department of Mathematics and Computer Science Eindhoven University of Technology, The Netherlands 20th June 2013 Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 1 / 23
An example for automotive Increasing number of applications; Extensive networking between them. Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 2 / 23
An example for automotive Increasing number of applications; Extensive networking between them. Why this growth? Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 2 / 23
An example for automotive Chip Design Magazine (Jan. 2005) Increasing number of applications; Extensive networking between them. Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 3 / 23
Coming from a federated architecture... each application has dedicated hardware: Component 1 Component 2... τ n... τ n RTOS+ middleware Hardware (CPU: 100 MHz) CAN RTOS+ middleware Hardware (CPU: 100 MHz) Legend: task Send or receive events Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 4 / 23
An example for automotive Reduce the number of nodes Trend: Fewer and more powerful nodes Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 5 / 23
An example for automotive Reduce the number of nodes Trend: Fewer and more powerful nodes Integration problem: applications may share resources; an application may have complex timing constraints. Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 5 / 23
Towards an integrated architecture... multiple applications share hardware: Comp. 3 Comp. 4 Component 1 τ n τ n... τ n Component 2 Component 5... τ n... τ n RTOS+middleware Hardware (CPU: 200 MHz) CAN RTOS+middleware Hardware (CPU: 200 MHz) Legend: task Virtual processor Virtual network bus Send or receive events Integration problem: each application may have complex timing constraints. applications may share resources; Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 6 / 23
Traditional solution to complex timing constraints Offline application synthesis and scheduling of the entire system Functional model: + Timing constraints: end-to-end deadline: χ time units period: T time units T time units T time units Analyse χ time units Legend: Job arrival Job deadline Job completion Job execution Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 7 / 23
Traditional solution to complex timing constraints Deployment on off-the-shelf operating system: Functional model: + Timing constraints: end-to-end deadline: χ time units period: T time units Thrown away after deployment T time units T time units Legacy χ time units Legend: Job arrival Job deadline Job completion Job execution Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 8 / 23
Resource sharing between applications Use spare resources for other applications: Legacy other apps Legend: Job arrival Job deadline Job completion Job execution Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 9 / 23
Traditional solution to resource sharing Capture constraints in a resource-supply contract: Legacy other apps Legend: Job arrival Job deadline Job completion Job execution W. Wang, A. K. Mok, and G. Fohler. Pre-scheduling. RTSJ, 30:83 103, 2005. Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 10 / 23
Traditional solution to resource sharing Issue 1/2 Capture constraints in a resource-supply contract: + other apps Legend: Job arrival Job deadline Job completion Job execution Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 11 / 23
Traditional solution to resource sharing Issue 1/2 Capture constraints in a resource-supply contract: + other apps Legend: Job arrival Job deadline Job completion Job execution Composition of systems with arbitrary small utilization may be impossible! Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 11 / 23
Traditional solution to resource sharing Issue 2/2 Capture constraints in a resource-supply contract: other apps Legend: Job arrival Job deadline Job completion Job execution align schedule and resource supply manually composition requires additional application analysis (find grey areas) Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 12 / 23
Traditional solution to resource sharing Issue 2/2 Capture constraints in a resource-supply contract: other apps Legend: Job arrival Job deadline Job completion Job execution align schedule and resource supply manually composition requires additional application analysis (find grey areas) Supporting the legacy? Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 12 / 23
Problem with resource sharing and complex constraints Capture constraints in a resource-supply contract: other apps Legend: Job arrival Job deadline Job completion Job execution Instead, can we: decouple schedule and resource supply? find a worst-case virtual platform using? Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 13 / 23
Resource sharing can affect timing constraints Towards independent alignment of schedule and resource supply: Legacy 1 other apps 2 Legend: Job arrival Job deadline Job completion Job execution Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 14 / 23
Resource sharing can affect timing constraints Legacy 1 other apps 2? Legend: Job arrival Job deadline Job completion Job execution Blocking may change the execution order of (other) jobs! Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 15 / 23
Our solution: disallow blocking takes any effects Legacy Desired solution Legend: Job arrival Job deadline Job completion Job execution Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 16 / 23
Our solution: disallow blocking takes any effects Legacy Desired solution Worst catch up: units of processor time Legend: Job arrival Job deadline Job completion Job execution Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 17 / 23
Solution outline: virtual scheduling Application requirement: Every sliding window of length t, we must receive t time units. 1 Worst catch up: 2 units of processor time Legend: Job arrival Job deadline Job completion Job execution Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 18 / 23
Solution outline: virtual scheduling Application requirement: Every sliding window of length t, we must receive t time units. 1 Worst catch up: 2 units of processor time Legend: Job arrival Job deadline Job completion Job execution If the virtual platform satisfies this requirement: it takes at most time units to catch up. Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 18 / 23
Virtual scheduling: replicate the original schedule 1 Bookkeeping: a i : time stamp the arrival of job J i ; r i : time stamp the release of job J i ; monitor the processor supply from r i onwards. Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 19 / 23
Virtual scheduling: replicate the original schedule 1 Bookkeeping: a i : time stamp the arrival of job J i ; r i : time stamp the release of job J i ; monitor the processor supply from r i onwards. 2 Job arbitration: buffer the arrival of a job (a i ; J i ); release job J i after (a i a i 1 ) units of processor time after r i 1. a i r i time units a i+1 ξ time units time units ri+1 ξ time units a i+2 r i+2 time units Legend: Job arrival Job release Job completion Job execution Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 19 / 23
Virtual scheduling: replicate the original schedule 1 Bookkeeping: a i : time stamp the arrival of job J i ; r i : time stamp the release of job J i ; monitor the processor supply from r i onwards. 2 Job arbitration: buffer the arrival of a job (a i ; J i ); release job J i after (a i a i 1 ) units of processor time after r i 1. a i r i time units a i+1 ξ time units time units ri+1 ξ time units a i+2 r i+2 time units Legend: Job arrival Job release Job completion Job execution Remember: worst catch up of time units! Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 19 / 23
Back to the integration problem... Federated application 1 Component 1 Component 2... τ n RTOS+ middleware Hardware (CPU: 100 MHz) CAN Multiple integrated applications Comp. 3 Comp. 4 Component 1... τ n RTOS+ middleware Hardware (CPU: 100 MHz) τ n τ n... τ n Legend: task Virtual processor Virtual network bus Send or receive events α = 100 MHz / 200 MHz Component 2 Component 5... τ n... τ n RTOS+middleware RTOS+middleware Hardware (CPU: 200 MHz) CAN Hardware (CPU: 200 MHz) Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 20 / 23
Bounded-delay partition upon a fast processor Unit of composition: a 100 MHz virtual processor on a 200 MHz physical processor, with at most a delay of time units. processor time (t) lsbf(t) α 0 time (t) Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 21 / 23
Bounded-delay partition upon a fast processor Unit of composition: a 100 MHz virtual processor on a 200 MHz physical processor, with at most a delay of time units. processor time (t) lsbf(t) α 0 time (t) How to implement this? Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 21 / 23
Example implementation: periodic allocations Bounded-delay versus EDP model (Easwaran et al., RTSS 2007): processor time (t) 4Θ sbf Ω(Π,Θ, ) (t) 3Θ lsbf Ω(Π,Θ, ) (t) 2Θ Θ α 0 0 Θ Π + 2Θ 2Π + 2Θ 3Π + 2Θ 4Π + 2Θ time (t) Π Π Π Π Π Processor supply: Θ Θ Θ Θ Θ Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 22 / 23
Conclusions We proposed virtual scheduling: replicate a schedule regardless of blocking; decouple the processor supply and the schedule of an application. Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 23 / 23
Conclusions We proposed virtual scheduling: replicate a schedule regardless of blocking; decouple the processor supply and the schedule of an application. Advantages: intuitive notion of allowable delays, ; independent of the scheduling policy of jobs of the application; preserve complex timing constraints of legacy applications; allow resource sharing between (legacy) applications. Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 23 / 23
Conclusions We proposed virtual scheduling: replicate a schedule regardless of blocking; decouple the processor supply and the schedule of an application. Advantages: intuitive notion of allowable delays, ; independent of the scheduling policy of jobs of the application; preserve complex timing constraints of legacy applications; allow resource sharing between (legacy) applications. Future work: from a single processor to multi-processors composition of distributed systems Martijn van den Heuvel (TU/e, SAN) Virtual scheduling 20th June 2013 23 / 23