Adaptive Scheduling Parameters Manager for A.Balsini SCHED DEADLINE - - PowerPoint PPT Presentation

adaptive scheduling parameters manager for
SMART_READER_LITE
LIVE PREVIEW

Adaptive Scheduling Parameters Manager for A.Balsini SCHED DEADLINE - - PowerPoint PPT Presentation

SCHED DL: Adaptive Scheduling Parameters Manager Adaptive Scheduling Parameters Manager for A.Balsini SCHED DEADLINE Introduction Problem Optimistic vs Pessimistic Alessio Balsini Tools Overview a.balsini@sssup.it Kernel Module


slide-1
SLIDE 1

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Adaptive Scheduling Parameters Manager for SCHED DEADLINE

Alessio Balsini a.balsini@sssup.it

Universit` a di Pisa, Scuola Superiore Sant’Anna

Workshop on Real-Time Scheduling in the Linux Kernel 27 June 2014

slide-2
SLIDE 2

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Introduction

Context: soft real-time periodic tasks scheduling Subcontext: multimedia audio/video reproduction Problem: tradeoff between overprovisioning and QoS Solution: a set of tools that manage SCHED DEADLINE parameters adaptively

slide-3
SLIDE 3

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Scheduling Soft Real-Time Periodic Tasks

  • What Happens

Computational request at each activation may heavily differ.

Figure : Ideal Figure : Real

slide-4
SLIDE 4

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Scheduling Soft Real-Time Periodic Tasks

  • Examples

Figure : Back to the Future (MKV)

slide-5
SLIDE 5

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Scheduling Soft Real-Time Periodic Tasks

  • Examples

Figure : Blade Runner (AVI)

slide-6
SLIDE 6

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Scheduling Soft Real-Time Periodic Tasks

  • Examples

Figure : Superman Returns (MP4)

slide-7
SLIDE 7

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Scheduling Soft Real-Time Periodic Tasks

  • Relevant Parameters?

In SCHED DEADLINE it is possible to configure (task based) Period Relative Deadline Bandwidth However, in the considered application context, a single parameter can be enough

Response Time

slide-8
SLIDE 8

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Scheduling Soft Real-Time Periodic Tasks

  • Relevant Parameters?

In SCHED DEADLINE it is possible to configure (task based) Period Relative Deadline Bandwidth However, in the considered application context, a single parameter can be enough

Response Time

slide-9
SLIDE 9

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Problem Response Time to SCHED DEADLINE: R → R3

How to generate SCHED DEADLINE parameters starting from the Response Time?

1 Period

Equal to the Response Time

2 Relative Deadline

Equal to the Period

3 Bandwidth

?

slide-10
SLIDE 10

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Problem Response Time to SCHED DEADLINE: R → R3

How to generate SCHED DEADLINE parameters starting from the Response Time?

1 Period

Equal to the Response Time

2 Relative Deadline

Equal to the Period

3 Bandwidth

?

slide-11
SLIDE 11

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Problem Response Time to SCHED DEADLINE: R → R3

How to generate SCHED DEADLINE parameters starting from the Response Time?

1 Period

Equal to the Response Time

2 Relative Deadline

Equal to the Period

3 Bandwidth

?

slide-12
SLIDE 12

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Problem Response Time to SCHED DEADLINE: R → R3

How to generate SCHED DEADLINE parameters starting from the Response Time?

1 Period

Equal to the Response Time

2 Relative Deadline

Equal to the Period

3 Bandwidth

?

slide-13
SLIDE 13

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Problem Response Time to SCHED DEADLINE: R → R3

How to generate SCHED DEADLINE parameters starting from the Response Time?

1 Period

Equal to the Response Time

2 Relative Deadline

Equal to the Period

3 Bandwidth

?

slide-14
SLIDE 14

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Problem Response Time to SCHED DEADLINE: R → R3

How to generate SCHED DEADLINE parameters starting from the Response Time?

1 Period

Equal to the Response Time

2 Relative Deadline

Equal to the Period

3 Bandwidth

?

slide-15
SLIDE 15

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Problem Response Time to SCHED DEADLINE: R → R3

How to generate SCHED DEADLINE parameters starting from the Response Time?

1 Period

Equal to the Response Time

2 Relative Deadline

Equal to the Period

3 Bandwidth

?

slide-16
SLIDE 16

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Computational Requirements

  • Is the glass half empty or half full?

Warning: Choosing the bandwidth may cause headaches

✌ Optimistic

1 Low QoS 2 Resources-driven?

Pessimistic

1 Best QoS 2 Waste of resources

slide-17
SLIDE 17

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Computational Requirements

  • Is the glass half empty or half full?

Warning: Choosing the bandwidth may cause headaches

✌ Optimistic

1 Low QoS 2 Resources-driven?

Pessimistic

1 Best QoS 2 Waste of resources

slide-18
SLIDE 18

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Computational Requirements

  • Is the glass half empty or half full?

Warning: Choosing the bandwidth may cause headaches

✌ Optimistic

1 Low QoS 2 Resources-driven?

Pessimistic

1 Best QoS 2 Waste of resources

slide-19
SLIDE 19

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Computational Requirements

  • Is the glass half empty or half full?

Warning: Choosing the bandwidth may cause headaches

✌ Optimistic

1 Low QoS 2 Resources-driven?

Pessimistic

1 Best QoS 2 Waste of resources

slide-20
SLIDE 20

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Computational Requirements

  • Is the glass half empty or half full?

Warning: Choosing the bandwidth may cause headaches

✌ Optimistic

1 Low QoS 2 Resources-driven?

Pessimistic

1 Best QoS 2 Waste of resources

slide-21
SLIDE 21

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Computational Requirements

  • Is the glass half empty or half full?

Warning: Choosing the bandwidth may cause headaches

✌ Optimistic

1 Low QoS 2 Resources-driven?

Pessimistic

1 Best QoS 2 Waste of resources

slide-22
SLIDE 22

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Computational Requirements

  • Is the glass half empty or half full?

Warning: Choosing the bandwidth may cause headaches

✌ Optimistic

1 Low QoS 2 Resources-driven?

Pessimistic

1 Best QoS 2 Waste of resources

slide-23
SLIDE 23

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Another possible approach? Dynamic!

  • Let’s see how much you drank

The bandwidth is dynamically (periodically) chosen for each SCHED DEADLINE task, depending on the history of the required computational times. It is a feedback loop controller.

But if this controller modifies the bandwidth, isn’t it just like removing the CBS from SCHED DEADLINE? Yes and no.

1 Adaptation delay: for the transitory 2 Global controller: for the fairness

slide-24
SLIDE 24

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Another possible approach? Dynamic!

  • Let’s see how much you drank

The bandwidth is dynamically (periodically) chosen for each SCHED DEADLINE task, depending on the history of the required computational times. It is a feedback loop controller.

But if this controller modifies the bandwidth, isn’t it just like removing the CBS from SCHED DEADLINE? Yes and no.

1 Adaptation delay: for the transitory 2 Global controller: for the fairness

slide-25
SLIDE 25

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Another possible approach? Dynamic!

  • Let’s see how much you drank

The bandwidth is dynamically (periodically) chosen for each SCHED DEADLINE task, depending on the history of the required computational times. It is a feedback loop controller.

But if this controller modifies the bandwidth, isn’t it just like removing the CBS from SCHED DEADLINE? Yes and no.

1 Adaptation delay: for the transitory 2 Global controller: for the fairness

slide-26
SLIDE 26

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Another possible approach? Dynamic!

  • Let’s see how much you drank

The bandwidth is dynamically (periodically) chosen for each SCHED DEADLINE task, depending on the history of the required computational times. It is a feedback loop controller.

But if this controller modifies the bandwidth, isn’t it just like removing the CBS from SCHED DEADLINE? Yes and no.

1 Adaptation delay: for the transitory 2 Global controller: for the fairness

slide-27
SLIDE 27

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Another possible approach? Dynamic!

  • Let’s see how much you drank

The bandwidth is dynamically (periodically) chosen for each SCHED DEADLINE task, depending on the history of the required computational times. It is a feedback loop controller.

But if this controller modifies the bandwidth, isn’t it just like removing the CBS from SCHED DEADLINE? Yes and no.

1 Adaptation delay: for the transitory 2 Global controller: for the fairness

slide-28
SLIDE 28

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Tools

slide-29
SLIDE 29

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Tools

Kernel Module: SCHED DEADLINE Spy Daemon: SCHED DEADLINE Dynamic Manager Configuration GUI: SchedConfigTool

slide-30
SLIDE 30

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Hi-level Point of View

  • Overall Block Scheme
slide-31
SLIDE 31

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Kernel Module: SCHED DEADLINE Spy

  • Userspace

This module creates a file for each SCHED DEADLINE task

/proc/sched deadline/[PID]

Containing four columns: 1401468028 22757242 10149132 N 1401468028 22757242 86353 N 1401468028 62757243 37679835 Y 1401468028 94757243 26311134 N . . . first two columns are the kernel time (seconds and nanoseconds) of the measurement third column is the job execution time (nanoseconds) last column says if execution exceeds the bandwidth (Yes/No)

slide-32
SLIDE 32

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Kernel Module: SCHED DEADLINE Spy

  • Implementation Hints

Kernel probes: Kprobes Probes are placed around the kernel and the instrumentation codes are executed when the processor encounters those probe

  • point. With Jprobes it is also possible to access function

arguments. This module attaches probes to

enqueue task dl and update dl entity

Jprobes are used to create tasks’ statistics. Other callbacks are provided, managing all the statistics sequential files.

slide-33
SLIDE 33

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Daemon: SCHED DEADLINE Dynamic Manager

  • Interface

This tool provides the following DBus interface

core.sched.dl.ProcessManager

with the following methods: xml: requires a string input, corresponding to the path of the XML file containing the task information fixed add: adds a new fixed task to the control list, with the defined SCHED DEADLINE parameters fixed launch: creates a new fixed task and adds it to the control list, with the defined SCHED DEADLINE parameters control: adds a new dynamic task to the control list, with the defined response time parameter launch: creates a new dynamic task and adds it to the control list, with the defined response time parameter

slide-34
SLIDE 34

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Daemon: SCHED DEADLINE Dynamic Manager

  • Interface, Sample Configuration

<?xml v e r s i o n =”1.0”?> <SchedulingAlgorithm name=”SCHED DEADLINE”> <path >/usr / bin / executable </path> <args> −p parameter </args> <runtime >28000000</ runtime> <deadline >33333333</ deadline > <period >33333333</ period > </SchedulingAlgorithm > XML configuration for SCHED DEADLINE Dynamic Manager

slide-35
SLIDE 35

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Daemon: SCHED DEADLINE Dynamic Manager

  • Implementation, Controller Local

One controller local for each dynamically scheduled task It performs the following operations cyclically

  • btain task statistics

run the Control Algorithm to calculate the best utilization factor send the computed utilization factor to the global controller

Note: The current control algorithm implements the worst case within a window of samples

slide-36
SLIDE 36

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Daemon: SCHED DEADLINE Dynamic Manager

  • Implementation, Controller Global

It performs the following operations cyclically check the schedulability of all the SCHED DEADLINE utilization factors

n

  • i=1

BD,i TD,i +

m

  • i=1

BF,i TF,i ≤ BSD D: Dynamic, F: Fixed

if not verified, use the Spring With no Length Constraints algorithm to compress the dynamic tasks’ requirements ∀i, U′

D,i = BD,i

TD,i − (UD − Bresidual) · TD,i n

i=1 TD,i

update SCHED DEADLINE parameters

slide-37
SLIDE 37

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Configuration Generator: SchedConfigTool

slide-38
SLIDE 38

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Configuration Generator: SchedConfigTool

slide-39
SLIDE 39

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Performance

slide-40
SLIDE 40

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Response Times

  • MPlayer Without SCHED DEADLINE

Figure : Eve Online Rubicon (MP4) without SCHED DEADLINE

slide-41
SLIDE 41

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Response Times

  • MPlayer With Dynamic Manager, Alone

Figure : Eve Online Rubicon (MP4) Dynamic Manager, Alone

Controller Global period: 1s, Controller Local window size: 50

slide-42
SLIDE 42

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Response Times

  • MPlayer With Dynamic Manager, With Fixed

Figure : Eve Online Rubicon (MP4) Dynamic Manager, Running Together With Several Fixed Parameters SCHED DEADLINE Tasks

Controller Global period: 1s, Controller Local window size: 50

slide-43
SLIDE 43

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Response Times

  • MPlayer With Dynamic Manager, With Other

Figure : Eve Online Rubicon (MP4) Dynamic Manager, Running Together With Several Other Linux Tasks

Controller Global period: 1s, Controller Local window size: 50

slide-44
SLIDE 44

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Practical Session

slide-45
SLIDE 45

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Repositories

SCHED DEADLINE Spy

github.com/balsini/sched-deadline-spy

SCHED DEADLINE Dynamic Manager

github.com/balsini/sched-deadline-dynamic-manager

SchedConfigTool

github.com/balsini/SchedConfigTool

slide-46
SLIDE 46

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

References

  • L. Palopoli, T. Cucinotta, L. Marzario, G. Lipari, AQoSA -

Adaptive Quality of Service Architecture. Wiley InterScience, 2008.

  • G. C. Buttazzo, Hard Real-Time Computing Systems:

Predictable Scheduling Algorithms and Applications 3rd. Springer Publishing Company, 2011.

slide-47
SLIDE 47

SCHED DL: Adaptive Scheduling Parameters Manager A.Balsini Introduction

Problem Optimistic vs Pessimistic

Tools

Overview Kernel Module Daemon Configuration Generator GUI

Conclusions

Performance Hands On

References

Repositories References

Thank You Alessio Balsini ✉ a.balsini@sssup.it