Linux as a Real-Time OS 2 Tuesday, July 9, 13 2 Linux as a - - PowerPoint PPT Presentation

linux as a real time os
SMART_READER_LITE
LIVE PREVIEW

Linux as a Real-Time OS 2 Tuesday, July 9, 13 2 Linux as a - - PowerPoint PPT Presentation

A Comparison of Scheduling Latency in Linux, PREEMPT_RT, and LITMUS RT Felipe Cerqueira and Bjrn Brandenburg July 9th, 2013 1 Tuesday, July 9, 13 1 Linux as a Real-Time OS 2 Tuesday, July 9, 13 2 Linux as a Real-Time OS Optimizing system


slide-1
SLIDE 1

July 9th, 2013

A Comparison of Scheduling Latency in Linux, PREEMPT_RT, and LITMUSRT

Felipe Cerqueira and Björn Brandenburg

1

1 Tuesday, July 9, 13

slide-2
SLIDE 2

2

Linux as a Real-Time OS

2 Tuesday, July 9, 13

slide-3
SLIDE 3

Optimizing system responsiveness

3

Linux as a Real-Time OS

3 Tuesday, July 9, 13

slide-4
SLIDE 4

4

PREEMPT_RT (Linux)

Linux as a Real-Time OS

Optimizing system responsiveness

4 Tuesday, July 9, 13

slide-5
SLIDE 5

Linux as a Real-Time OS

5

PREEMPT_RT (Linux)

Optimizing system responsiveness Algorithmic changes based on real-time systems research

5 Tuesday, July 9, 13

slide-6
SLIDE 6

6

Linux as a Real-Time OS

PREEMPT_RT (Linux)

Optimizing system responsiveness Algorithmic changes based on real-time systems research

6 Tuesday, July 9, 13

slide-7
SLIDE 7

PREEMPT_RT

✤ Main real-time branch of Linux ✤ Goal: decrease scheduling latency through the use of low-level

hacks

✤ Convert in-kernel spinlocks into (preemptable) mutexes ✤ Limit the extent of non-preemptable sections ✤ Commonly evaluated with cyclictest ✤ Single, easy-to-compare measure of scheduling latency as

  • utput

7

7 Tuesday, July 9, 13

slide-8
SLIDE 8

✤ Testbed for applied real-time systems research ✤ Goal ✤ Allow implementation and evaluation of novel multiprocessor

schedulers and synchronization protocols

✤ NOT to reduce scheduling latency ✤ Evaluated with Feather-Trace ✤ Flexible, fine-grained measurement of different overheads 8

8 Tuesday, July 9, 13

slide-9
SLIDE 9

✤ Testbed for applied real-time systems research ✤ Goal ✤ Allow implementation and evaluation of novel multiprocessor

schedulers and synchronization protocols

✤ NOT to reduce scheduling latency ✤ Evaluated with Feather-Trace ✤ Flexible, fine-grained measurement of different overheads 9

How do LITMUSRT and PREEMPT_RT compare?

9 Tuesday, July 9, 13

slide-10
SLIDE 10

✤ Testbed for applied real-time systems research ✤ Goal ✤ Allow implementation and evaluation of novel multiprocessor

schedulers and synchronization protocols

✤ NOT to reduce scheduling latency ✤ Evaluated with Feather-Trace ✤ Flexible, fine-grained measurement of different overheads 10

How do LITMUSRT and PREEMPT_RT compare? It is not straightforward to compare them!

10 Tuesday, July 9, 13

slide-11
SLIDE 11

Objective

11

PREEMPT_RT (Linux)

Direct comparison of scheduling latency between LITMUSRT and PREEMPT_RT

vs.

11 Tuesday, July 9, 13

slide-12
SLIDE 12

12

Background

12 Tuesday, July 9, 13

slide-13
SLIDE 13

How is LITMUSRT evaluated?

✤ Evaluated with ✤ Lightweight tracing framework for measuring fine-grained

  • verheads (e.g., IPI latency, context-switching overhead,

etc.)

✤ Extensively used (20+ publications) ✤ Suitable for schedulability analysis ✤ Check if a task is going to miss a deadline 13

13 Tuesday, July 9, 13

slide-14
SLIDE 14

How is PREEMPT_RT evaluated?

✤ Evaluated with cyclictest ✤ Standard benchmark for

assessing real-time responsiveness

✤ Creator: Thomas Gleixner

Current maintainer: Clark Williams

✤ Reports scheduling latency as a single measure ✤ Treats hardware and OS as a black-box 14

14 Tuesday, July 9, 13

slide-15
SLIDE 15

Scheduling Latency

interrupt!

!

ISR called

brake sensor HP task ECU

15

Time until the highest-priority task is scheduled

15 Tuesday, July 9, 13

slide-16
SLIDE 16

T

Scheduling Latency

interrupt!

!

ISR called scheduler invoked

s

T T

w a k e u p t a s k

ZZ ZZ

16

Time until the highest-priority task is scheduled

16 Tuesday, July 9, 13

slide-17
SLIDE 17

T

Scheduling Latency

interrupt!

!

ISR called scheduler invoked

s

T T

w a k e u p t a s k

task picked

P

17

Time until the highest-priority task is scheduled

17 Tuesday, July 9, 13

slide-18
SLIDE 18

T

Scheduling Latency

interrupt!

!

ISR called scheduler invoked

s

T T

w a k e u p t a s k

task picked

P

Perform context switch C switched

18

Time until the highest-priority task is scheduled

18 Tuesday, July 9, 13

slide-19
SLIDE 19

T

Scheduling Latency

interrupt!

!

ISR called scheduler invoked

s

T T

w a k e u p t a s k

task picked

P

Perform context switch

19

scheduling latency Time until the highest-priority task is scheduled C switched

19 Tuesday, July 9, 13

slide-20
SLIDE 20

20

Init Exit Measure

How does cyclictest measure Scheduling Latency?

20 Tuesday, July 9, 13

slide-21
SLIDE 21

21

Init Exit Measure Measuring thread is granted real-time status.

How does cyclictest measure Scheduling Latency?

POSIX sched_setscheduler( )

21 Tuesday, July 9, 13

slide-22
SLIDE 22

22

Init Exit Measure

How does cyclictest measure Scheduling Latency?

22 Tuesday, July 9, 13

slide-23
SLIDE 23

How does cyclictest measure Scheduling Latency?

23

Init Exit Measure Periodically setup one-shot timers with nanosleep. Calculate delta between the instant the task starts executing and the instant the timer should have fired.

23 Tuesday, July 9, 13

slide-24
SLIDE 24

24

Init Exit Measure

How does cyclictest measure Scheduling Latency?

24 Tuesday, July 9, 13

slide-25
SLIDE 25

25

Init Exit Measure Measuring thread returns to best-effort status.

How does cyclictest measure Scheduling Latency?

POSIX sched_setscheduler( )

25 Tuesday, July 9, 13

slide-26
SLIDE 26

cyclictest on LITMUSRT

26

Init Exit Measure LITMUSRT does not use POSIX API to setup real-time tasks!

26 Tuesday, July 9, 13

slide-27
SLIDE 27

cyclictest on LITMUSRT

27

Init Exit Measure cyclictest works, but does not measure what we expect... LITMUSRT does not use POSIX API to setup real-time tasks!

27 Tuesday, July 9, 13

slide-28
SLIDE 28

Porting cyclictest to LITMUSRT

28

Init Exit Measure cyclictest works, but does not measure what we expect... LITMUSRT does not use POSIX API to setup real-time tasks! POSIX sched_setscheduler( ) POSIX sched_setscheduler( )

28 Tuesday, July 9, 13

slide-29
SLIDE 29

Porting cyclictest to LITMUSRT

29

Init Exit Measure POSIX sched_setscheduler( ) POSIX sched_setscheduler( ) cyclictest works, but does not measure what we expect... LITMUSRT does not use POSIX API to setup real-time tasks!

29 Tuesday, July 9, 13

slide-30
SLIDE 30

30

Measure LITMUSRT API task_mode() LITMUSRT API task_mode() LITMUSRT Init LITMUSRT Exit No changes in the measurement phase, no bias.

Porting cyclictest to LITMUSRT

30 Tuesday, July 9, 13

slide-31
SLIDE 31

31

Study

31 Tuesday, July 9, 13

slide-32
SLIDE 32

Questions that We Address

32

Linux (core) Scheduler + Dispatcher Userspace Stock Linux

32 Tuesday, July 9, 13

slide-33
SLIDE 33

Questions that We Address

32

Linux (core) Scheduler + Dispatcher Userspace Stock Linux

32 Tuesday, July 9, 13

slide-34
SLIDE 34

The Cost of LITMUSRT

33

Linux (core) Scheduling Policy Plugins Userspace LITMUSRT Dispatcher Linux (core) Scheduler + Dispatcher Userspace Stock Linux

33 Tuesday, July 9, 13

slide-35
SLIDE 35

The Cost of LITMUSRT

34

Linux (core) Userspace LITMUSRT Linux (core) Scheduler + Dispatcher Userspace Stock Linux How much latency does the scheduling policy interface add to the system? Question 1 Scheduling Policy Plugins Dispatcher

34 Tuesday, July 9, 13

slide-36
SLIDE 36

LITMUSRT vs. PREEMPT_RT

35

Linux (core) Scheduler + Dispatcher Userspace PREEMPT_RT Linux (core) Scheduler + Dispatcher Userspace Stock Linux Linux (core) Userspace LITMUSRT Scheduling Policy Plugins Dispatcher

35 Tuesday, July 9, 13

slide-37
SLIDE 37

LITMUSRT vs. PREEMPT_RT

36

Linux (core) Scheduler + Dispatcher Userspace PREEMPT_RT Linux (core) Scheduler + Dispatcher Userspace Stock Linux Linux (core) Userspace LITMUSRT Scheduling Policy Plugins Dispatcher

36 Tuesday, July 9, 13

slide-38
SLIDE 38

LITMUSRT vs. PREEMPT_RT

36

Linux (core) Scheduler + Dispatcher Userspace PREEMPT_RT Linux (core) Scheduler + Dispatcher Userspace Stock Linux Linux (core) Userspace LITMUSRT Scheduling Policy Plugins Dispatcher

36 Tuesday, July 9, 13

slide-39
SLIDE 39

LITMUSRT vs. PREEMPT_RT

37

What is the penalty for LITMUSRT not being based on PREEMPT_RT?

Question 2 Linux (core) Userspace LITMUSRT Linux (core) Scheduler + Dispatcher Userspace PREEMPT_RT Scheduling Policy Plugins Dispatcher

37 Tuesday, July 9, 13

slide-40
SLIDE 40

Evaluation

38

Linux (core) Scheduler + Dispatcher Userspace

38 Tuesday, July 9, 13

slide-41
SLIDE 41

Evaluation

38

Linux (core) Scheduler + Dispatcher

Userspace

38 Tuesday, July 9, 13

slide-42
SLIDE 42

Evaluation

39

Linux (core) Scheduler + Dispatcher Userspace cyclictest background workload

+

39 Tuesday, July 9, 13

slide-43
SLIDE 43

Background Workloads

CPU-bound background tasks I/O-bound background tasks

40

background tasks

NO

40 Tuesday, July 9, 13

slide-44
SLIDE 44

Experimental Setup

Different kernels:

1.LITMUSRT (Linux 3.0)

Partitioned Fixed Priority (P-FP), Partitioned EDF with synchronization support (PSN-EDF), Global EDF with synchronization support (GSN-EDF)

2.PREEMPT_RT (Linux 3.8.13) 3.Unpatched Linux 3.0 and Linux 3.8.13

41

SCHED_FIFO

}

41 Tuesday, July 9, 13

slide-45
SLIDE 45

Experimental Setup

✤ 16-core Intel Xeon platform ✤ cyclictest’s standard setup: ✤ one real-time task per processor ✤ periods: {1000, 1500, 2000, ...} μs ✤ Duration: 20 minutes per experiment ✤ Almost 6 million samples for each case ✤ Results shown in microseconds 42

42 Tuesday, July 9, 13

slide-46
SLIDE 46

background tasks

NO

First Scenario

43

43 Tuesday, July 9, 13

slide-47
SLIDE 47

44

No Background Tasks

Scheduling Latency (μs)

5 10 15 20 P-FP (LITMUS^RT) Linux 3.0 PREEMPT_RT 11.2 13.9 15.3 2.7 2.9 3.5

Average (99% conf.) Maximum

44 Tuesday, July 9, 13

slide-48
SLIDE 48

5 10 15 20 P-FP (LITMUS^RT) Linux 3.0 PREEMPT_RT 11.2 13.9 15.3 2.7 2.9 3.5

45

No Background Tasks

Average (99% conf.) Maximum

Scheduling Latency (μs)

Similar max. and

  • avg. latency for Linux

3.0 and LITMUSRT.

45 Tuesday, July 9, 13

slide-49
SLIDE 49

5 10 15 20 P-FP (LITMUS^RT) Linux 3.0 PREEMPT_RT 11.2 13.9 15.3 2.7 2.9 3.5

46

No Background Tasks

Average (99% conf.) Maximum

Scheduling Latency (μs)

Improved max. latency for PREEMPT_RT Similar max. and

  • avg. latency for Linux

3.0 and LITMUSRT.

46 Tuesday, July 9, 13

slide-50
SLIDE 50

CPU-bound background tasks

Second Scenario

47

✤ Tasks running an infinite loop

accessing memory (read/write)

✤ Working set larger than L2

cache size

47 Tuesday, July 9, 13

slide-51
SLIDE 51

CPU-bound background tasks

Second Scenario

48

✤ Tasks running an infinite loop

accessing memory (read/write)

✤ Working set larger than L2

cache size Generates memory traffic and cache contention!

48 Tuesday, July 9, 13

slide-52
SLIDE 52

CPU-bound Background Tasks

49

Scheduling Latency (μs)

20 40 60 80 P-FP (LITMUS^RT) Linux 3.0 PREEMPT_RT 17.4 72.7 47.6 3.4 4.2 5.2

Average (99% conf.) Maximum

49 Tuesday, July 9, 13

slide-53
SLIDE 53

20 40 60 80 P-FP (LITMUS^RT) Linux 3.0 PREEMPT_RT 17.4 72.7 47.6 3.4 4.2 5.2

50

CPU-bound Background Tasks

Scheduling Latency (μs)

Average (99% conf.) Maximum

Latency under PREEMPT_RT is significantly lower.

50 Tuesday, July 9, 13

slide-54
SLIDE 54

20 40 60 80 P-FP (LITMUS^RT) Linux 3.0 PREEMPT_RT 17.4 72.7 47.6 3.4 4.2 5.2

51

Average (99% conf.) Maximum

Scheduling Latency (μs)

Latency under PREEMPT_RT is significantly lower. LITMUSRT’s latency lower than

  • n Linux 3.0?

CPU-bound Background Tasks

51 Tuesday, July 9, 13

slide-55
SLIDE 55

1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples

  • verhead in microseconds (bin size = 1.00us)

Linux 3.0: scheduling latency (CPU-bound bg tasks) min=2.04us max=72.73us avg=4.22us median=3.86us stdev=1.37us samples: total=5854711

LITMUSRT vs. Linux 3.0: CPU-bound Background Tasks

52

Linux 3.0 P-FP(LITMUSRT)

avg=4.22μs max=72.73μs avg=5.17μs max=47.59μs

log scale!

Scheduling Latency (μs) (Bin size = 1μs)

52 Tuesday, July 9, 13

slide-56
SLIDE 56

1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples

  • verhead in microseconds (bin size = 1.00us)

Linux 3.0: scheduling latency (CPU-bound bg tasks) min=2.04us max=72.73us avg=4.22us median=3.86us stdev=1.37us samples: total=5854711

LITMUSRT vs. Linux 3.0: CPU-bound Background Tasks

53

Linux 3.0 P-FP(LITMUSRT)

avg=4.22μs max=72.73μs avg=5.17μs max=47.59μs

Scheduling Latency (μs) (Bin size = 1μs)

3 samples out of ~6 million

53 Tuesday, July 9, 13

slide-57
SLIDE 57

1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples

  • verhead in microseconds (bin size = 1.00us)

Linux 3.0: scheduling latency (CPU-bound bg tasks) min=2.04us max=72.73us avg=4.22us median=3.86us stdev=1.37us samples: total=5854711

LITMUSRT vs. Linux 3.0: CPU-bound Background Tasks

54

Linux 3.0 P-FP(LITMUSRT)

avg=4.22μs max=72.73μs avg=5.17μs max=47.59μs

Scheduling Latency (μs) (Bin size = 1μs)

Slightly worse latencies

  • n average

54 Tuesday, July 9, 13

slide-58
SLIDE 58

1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples

  • verhead in microseconds (bin size = 1.00us)

Linux 3.0: scheduling latency (CPU-bound bg tasks) min=2.04us max=72.73us avg=4.22us median=3.86us stdev=1.37us samples: total=5854711

LITMUSRT vs. Linux 3.0: CPU-bound Background Tasks

55

Linux 3.0 P-FP(LITMUSRT)

avg=4.22μs max=72.73μs avg=5.17μs max=47.59μs

Scheduling Latency (μs) (Bin size = 1μs)

extra spinlock lack of low-level

  • ptimizations

55 Tuesday, July 9, 13

slide-59
SLIDE 59

20 40 60 80 P-FP (LITMUS^RT) Linux 3.0 PREEMPT_RT 17.4 72.7 47.6 3.4 4.2 5.2

56

CPU-bound Background Tasks

Average (99% conf.) Maximum

Scheduling Latency (μs)

LITMUSRT incurs slightly more latency than Linux 3.0 on average. Latency under PREEMPT_RT is significantly lower.

56 Tuesday, July 9, 13

slide-60
SLIDE 60

I/O-bound background tasks

Third Scenario

57

✤ hackbench: Linux scheduler stress tool

bonnie++: Disk and file system benchmark wget: Network activity

57 Tuesday, July 9, 13

slide-61
SLIDE 61

I/O-bound background tasks

Third Scenario

58

✤ hackbench: Linux scheduler stress tool

bonnie++: Disk and file system benchmark wget: Network activity Causes a lot of system calls and interrupts

58 Tuesday, July 9, 13

slide-62
SLIDE 62

I/O-bound Background Tasks

59

Scheduling Latency (μs)

1 10 100 1,000 10,000 P-FP (LITMUS^RT) Linux 3.0 PREEMPT_RT 44.2 4300.4 3956.5 4.1 6.4 6.6

Average (99% conf.) Maximum

log scale!

59 Tuesday, July 9, 13

slide-63
SLIDE 63

1 10 100 1,000 10,000 P-FP (LITMUS^RT) Linux 3.0 PREEMPT_RT 44.2 4300.4 3956.5 4.1 6.4 6.6

60

I/O-bound Background Tasks

Huge impact on scheduling latency under standard Linux.

Scheduling Latency (μs)

Average (99% conf.) Maximum

60 Tuesday, July 9, 13

slide-64
SLIDE 64

1 10 100 1,000 10,000 P-FP (LITMUS^RT) Linux 3.0 PREEMPT_RT 44.2 4300.4 3956.5 4.1 6.4 6.6

61

I/O-bound Background Tasks

Huge impact on scheduling latency under standard Linux.

Scheduling Latency (μs)

Average (99% conf.) Maximum

PREEMPT_RT is not affected by the interrupt load!

61 Tuesday, July 9, 13

slide-65
SLIDE 65

Summary

1.Cost of the scheduling plugin layer 2.LITMUSRT vs. PREEMPT_RT

62

62 Tuesday, July 9, 13

slide-66
SLIDE 66

Summary

1.Cost of the scheduling plugin layer 2.LITMUSRT vs. PREEMPT_RT

63

The overhead introduced by LITMUSRT is small

63 Tuesday, July 9, 13

slide-67
SLIDE 67

Summary

1.Cost of the scheduling plugin layer 2.LITMUSRT vs. PREEMPT_RT

64

The overhead introduced by LITMUSRT is small PREEMPT_RT significantly decreases scheduling latency.

64 Tuesday, July 9, 13

slide-68
SLIDE 68

Importance of Feather-Trace

✤ cyclictest was ported to LITMUSRT. ✤ Should it become the standard tool

for evaluating LITMUSRT?

65

65 Tuesday, July 9, 13

slide-69
SLIDE 69

Importance of Feather-Trace

✤ cyclictest was ported to LITMUSRT. ✤ Should it become the standard tool

for evaluating LITMUSRT?

66

NO!

66 Tuesday, July 9, 13

slide-70
SLIDE 70

T

Interference?

interrupt!

!

ISR called scheduler invoked

s

T T

w a k e u p t a s k

OOPS... a higher priority task

67

67 Tuesday, July 9, 13

slide-71
SLIDE 71

T

Interference?

interrupt!

!

ISR called scheduler invoked

s

T T

w a k e u p t a s k

another task picked

?

68

68 Tuesday, July 9, 13

slide-72
SLIDE 72

T

Interference?

interrupt!

!

ISR called scheduler invoked

s

T T

w a k e u p t a s k

another task picked

?

task picked

P

...

69

69 Tuesday, July 9, 13

slide-73
SLIDE 73

T

Interference?

interrupt!

!

ISR called scheduler invoked

s

T T

w a k e u p t a s k

another task picked

?

task picked

P

...

70

This length of this interval depends

  • n the execution of other tasks...

70 Tuesday, July 9, 13

slide-74
SLIDE 74

T

Interference?

interrupt!

!

ISR called scheduler invoked

s

T T

w a k e u p t a s k

another task picked

?

task picked

P

...

71

This length of this interval depends

  • n the execution of other tasks...

..., which depends on other kinds of overhead, preemptions, context switches, etc.

71 Tuesday, July 9, 13

slide-75
SLIDE 75

T

Interference?

interrupt!

!

ISR called scheduler invoked

s

T T

w a k e u p t a s k

another task picked

?

task picked

P

...

72

This length of this interval depends

  • n the execution of other tasks...

..., which depends on other kinds of overhead, preemptions, context switches, etc.

Overhead-aware schedulability analysis is required!

72 Tuesday, July 9, 13

slide-76
SLIDE 76

cyclictest or Feather-Trace?

73

BOTH!

cyclictest LITMUSRT/Feather-Trace

Practical, easy-to- understand measure Can easily compare responsiveness between kernels. For tasks other than the highest-priority ones, schedulability analysis is necessary. Only with Feather-Trace we obtain the data required for the analysis.

73 Tuesday, July 9, 13

slide-77
SLIDE 77

Conclusion

74

LITMUSRT: small overheads in comparison with stock Linux Scheduling latency should not be used as the sole metric for quantifying real-time guarantees PREEMPT_RT is highly necessary for Linux as a RTOS LITMUSRT will be ported to PREEMPT_RT soon

74 Tuesday, July 9, 13

slide-78
SLIDE 78

Thank You!

We also have a patch that implements Feather-Trace on top of standard Linux, enabling fine-grained measurements.

75

75 Tuesday, July 9, 13

slide-79
SLIDE 79

Appendix

76

76 Tuesday, July 9, 13

slide-80
SLIDE 80

77

Linux 3.0 vs. Linux 3.8.13

77 Tuesday, July 9, 13

slide-81
SLIDE 81

78

No Background Tasks

Scheduling Latency (μs)

5 10 15 20 25 Linux 3.0 Linux 3.8.13 19.7 13.9 2.9 2.9

Average Maximum

78 Tuesday, July 9, 13

slide-82
SLIDE 82

79

No Background Tasks

Scheduling Latency (μs)

5 10 15 20 25 Linux 3.0 Linux 3.8.13 19.7 13.9 2.9 2.9

Average Maximum

Similar averages

79 Tuesday, July 9, 13

slide-83
SLIDE 83

80

No Background Tasks

1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples

  • verhead in microseconds (bin size = 1.00us)

Linux 3.0: scheduling latency (no bg tasks) min=1.87us max=13.89us avg=2.89us median=2.77us stdev=0.51us samples: total=5854779 1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples Linux 3.8.13: scheduling latency (no bg tasks) min=1.52us max=19.73us avg=2.89us median=2.58us stdev=0.69us samples: total=5854801

Linux 3.0

avg=2.89μs max=13.89μs

Linux 3.8.13

avg=2.89μs max=19.73μs

Similar shapes

80 Tuesday, July 9, 13

slide-84
SLIDE 84

81

CPU-bound Background Tasks

Scheduling Latency (μs)

20 40 60 80 Linux 3.0 Linux 3.8.13 64.5 72.7 4.0 4.2

Average Maximum

81 Tuesday, July 9, 13

slide-85
SLIDE 85

82

CPU-bound Background Tasks

Scheduling Latency (μs)

20 40 60 80 Linux 3.0 Linux 3.8.13 64.5 72.7 4.0 4.2

Average Maximum

Similar averages

82 Tuesday, July 9, 13

slide-86
SLIDE 86

83

CPU-bound Background Tasks

1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples

  • verhead in microseconds (bin size = 1.00us)

Linux 3.0: scheduling latency (CPU-bound bg tasks) min=2.04us max=72.73us avg=4.22us median=3.86us stdev=1.37us samples: total=5854711 1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples Linux 3.8.13: scheduling latency (CPU-bound bg tasks) min=2.14us max=64.47us avg=4.02us median=3.67us stdev=1.20us samples: total=5854707

Linux 3.0

avg=4.22μs max=72.73μs

Linux 3.8.13

avg=4.02μs max=64.47μs

Similar shapes

83 Tuesday, July 9, 13

slide-87
SLIDE 87

I/O-bound Background Tasks

84

Scheduling Latency (μs)

1 10 100 1,000 10,000 Linux 3.0 Linux 3.8.13 5464.1 4300.4 6.2 6.4

Average Maximum

log scale!

84 Tuesday, July 9, 13

slide-88
SLIDE 88

I/O-bound Background Tasks

85

Scheduling Latency (μs)

1 10 100 1,000 10,000 Linux 3.0 Linux 3.8.13 5464.1 4300.4 6.2 6.4

Average Maximum

Similar averages

85 Tuesday, July 9, 13

slide-89
SLIDE 89

86

I/O-bound Background Tasks

1 10 100 1000 10000 100000 1e+06 1e+07 150 300 450 600 750 900 1050 1200 1350 number of samples

  • verhead in microseconds (bin size = 1.00us)

Linux 3.0: scheduling latency (IO-bound bg tasks) min=1.85us max=4300.43us avg=6.39us median=4.98us stdev=13.25us samples: total=5854674 1 10 100 1000 10000 100000 1e+06 1e+07 150 300 450 600 750 900 1050 1200 1350 number of samples Linux 3.8.13: scheduling latency (IO-bound bg tasks) min=1.85us max=5464.07us avg=6.23us median=4.60us stdev=15.91us samples: total=5854773

Linux 3.0

avg=6.39μs max=4300.43μs

Linux 3.8.13

avg=6.23μs max=5464.07μs

Similar shapes

86 Tuesday, July 9, 13

slide-90
SLIDE 90

87

LITMUSRT’s plugins

87 Tuesday, July 9, 13

slide-91
SLIDE 91

88

No Background Tasks

Scheduling Latency (μs)

7.5 15 22.5 30 P-FP PSN-EDF GSN-EDF 14.3 26.2 15.1 3.1 3.5 3.5

Average Maximum

88 Tuesday, July 9, 13

slide-92
SLIDE 92

No Background Tasks

89

1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples

  • verhead in microseconds (bin size = 1.00us)

LITMUS^RT P-EDF: scheduling latency (no bg tasks) min=1.76us max=26.17us avg=3.45us median=2.87us stdev=1.24us samples: total=5854783 1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90

  • verhead in microseconds (bin size = 1.00us)

LITMUS^RT G-EDF: scheduling latency (no bg tasks) min=1.59us max=14.34us avg=3.06us median=2.56us stdev=1.18us samples: total=5854797 1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples

  • verhead in microseconds (bin size = 1.00us)

LITMUS^RT P-FP: scheduling latency (no bg tasks) min=1.96us max=15.13us avg=3.45us median=3.10us stdev=1.03us samples: total=5854818

Similar shapes

PSN-EDF

avg=3.45μs max=26.17μs

GSN-EDF

avg=3.06μs max=14.34μs

P-FP

avg=3.45μs max=15.13μs

89 Tuesday, July 9, 13

slide-93
SLIDE 93

No Background Tasks

90

1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples

  • verhead in microseconds (bin size = 1.00us)

LITMUS^RT P-EDF: scheduling latency (no bg tasks) min=1.76us max=26.17us avg=3.45us median=2.87us stdev=1.24us samples: total=5854783 1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90

  • verhead in microseconds (bin size = 1.00us)

LITMUS^RT G-EDF: scheduling latency (no bg tasks) min=1.59us max=14.34us avg=3.06us median=2.56us stdev=1.18us samples: total=5854797 1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples

  • verhead in microseconds (bin size = 1.00us)

LITMUS^RT P-FP: scheduling latency (no bg tasks) min=1.96us max=15.13us avg=3.45us median=3.10us stdev=1.03us samples: total=5854818

Similar shapes

PSN-EDF

avg=3.45μs max=26.17μs

GSN-EDF

avg=3.06μs max=14.34μs

P-FP

avg=3.45μs max=15.13μs

2 samples

90 Tuesday, July 9, 13

slide-94
SLIDE 94

91

CPU-bound Background Tasks

Scheduling Latency (μs)

20 40 60 80 P-FP PSN-EDF GSN-EDF 60.2 73.3 47.6 5.8 5.1 5.2

Average Maximum

91 Tuesday, July 9, 13

slide-95
SLIDE 95

1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples

  • verhead in microseconds (bin size = 1.00us)

LITMUS^RT P-EDF: scheduling latency (CPU-bound bg tasks) min=2.40us max=73.27us avg=5.14us median=4.21us stdev=2.95us samples: total=5854739 1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90

  • verhead in microseconds (bin size = 1.00us)

LITMUS^RT G-EDF: scheduling latency (CPU-bound bg tasks) min=1.91us max=60.20us avg=5.81us median=5.39us stdev=2.51us samples: total=5854728 1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples

  • verhead in microseconds (bin size = 1.00us)

LITMUS^RT P-FP: scheduling latency (CPU-bound bg tasks) min=2.10us max=47.59us avg=5.17us median=4.37us stdev=2.75us samples: total=5854719

CPU-bound Background Tasks

92

PSN-EDF

avg=5.14μs max=73.27μs

GSN-EDF

avg=5.81μs max=60.20μs

P-FP

avg=5.17μs max=47.59μs

Similar shapes

92 Tuesday, July 9, 13

slide-96
SLIDE 96

1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples

  • verhead in microseconds (bin size = 1.00us)

LITMUS^RT P-EDF: scheduling latency (CPU-bound bg tasks) min=2.40us max=73.27us avg=5.14us median=4.21us stdev=2.95us samples: total=5854739 1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90

  • verhead in microseconds (bin size = 1.00us)

LITMUS^RT G-EDF: scheduling latency (CPU-bound bg tasks) min=1.91us max=60.20us avg=5.81us median=5.39us stdev=2.51us samples: total=5854728 1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples

  • verhead in microseconds (bin size = 1.00us)

LITMUS^RT P-FP: scheduling latency (CPU-bound bg tasks) min=2.10us max=47.59us avg=5.17us median=4.37us stdev=2.75us samples: total=5854719

CPU-bound Background Tasks

93

PSN-EDF

avg=5.14μs max=73.27μs

GSN-EDF

avg=5.81μs max=60.20μs

P-FP

avg=5.17μs max=47.59μs

5 samples

Similar shapes

93 Tuesday, July 9, 13

slide-97
SLIDE 97

I/O-bound Background Tasks

94

Scheduling Latency (μs)

1 10 100 1,000 10,000 P-FP PSN-EDF GSN-EDF 3905.8 3875.0 3956.5 11.0 6.6 6.6

Average Maximum

log scale!

94 Tuesday, July 9, 13

slide-98
SLIDE 98

I/O-bound Background Tasks

95

Scheduling Latency (μs)

1 10 100 1,000 10,000 P-FP PSN-EDF GSN-EDF 3905.8 3875.0 3956.5 11.0 6.6 6.6

Average Maximum

Similar results for P-FP and PSN-EDF

95 Tuesday, July 9, 13

slide-99
SLIDE 99

I/O-bound Background Tasks

96

Scheduling Latency (μs)

1 10 100 1,000 10,000 P-FP PSN-EDF GSN-EDF 3905.8 3875.0 3956.5 11.0 6.6 6.6

Average Maximum

Similar results for P-FP and PSN-EDF Higher average for GSN-EDF

96 Tuesday, July 9, 13

slide-100
SLIDE 100

1 10 100 1000 10000 100000 1e+06 1e+07 150 300 450 600 750 900 1050 1200 1350 number of samples

  • verhead in microseconds (bin size = 1.00us)

LITMUS^RT P-EDF: scheduling latency (IO-bound bg tasks) min=1.98us max=3874.99us avg=6.56us median=5.11us stdev=12.66us samples: total=5854606 1 10 100 1000 10000 100000 1e+06 1e+07 150 300 450 600 750 900 1050 1200 1350

  • verhead in microseconds (bin size = 1.00us)

LITMUS^RT G-EDF: scheduling latency (IO-bound bg tasks) min=2.26us max=3905.79us avg=10.95us median=7.38us stdev=14.11us samples: total=5854793 1 10 100 1000 10000 100000 1e+06 1e+07 150 300 450 600 750 900 1050 1200 1350 number of samples

  • verhead in microseconds (bin size = 1.00us)

LITMUS^RT P-FP: scheduling latency (IO-bound bg tasks) min=1.89us max=3956.48us avg=6.60us median=5.17us stdev=12.76us samples: total=5854660

I/O-bound Background Tasks

97

Similar shapes

PSN-EDF

avg=6.56μs max=3874.99μs

GSN-EDF

avg=10.95μs max=3905.79μs

P-FP

avg=6.60μs max=3956.48μs

97 Tuesday, July 9, 13

slide-101
SLIDE 101

1 10 100 1000 10000 100000 1e+06 1e+07 150 300 450 600 750 900 1050 1200 1350 number of samples

  • verhead in microseconds (bin size = 1.00us)

LITMUS^RT P-EDF: scheduling latency (IO-bound bg tasks) min=1.98us max=3874.99us avg=6.56us median=5.11us stdev=12.66us samples: total=5854606 1 10 100 1000 10000 100000 1e+06 1e+07 150 300 450 600 750 900 1050 1200 1350

  • verhead in microseconds (bin size = 1.00us)

LITMUS^RT G-EDF: scheduling latency (IO-bound bg tasks) min=2.26us max=3905.79us avg=10.95us median=7.38us stdev=14.11us samples: total=5854793 1 10 100 1000 10000 100000 1e+06 1e+07 150 300 450 600 750 900 1050 1200 1350 number of samples

  • verhead in microseconds (bin size = 1.00us)

LITMUS^RT P-FP: scheduling latency (IO-bound bg tasks) min=1.89us max=3956.48us avg=6.60us median=5.17us stdev=12.76us samples: total=5854660

I/O-bound Background Tasks

98

Similar shapes

PSN-EDF

avg=6.56μs max=3874.99μs

GSN-EDF

avg=10.95μs max=3905.79μs

P-FP

avg=6.60μs max=3956.48μs

Higher average

98 Tuesday, July 9, 13

slide-102
SLIDE 102

99

threadirqs in Linux 3.8.13

99 Tuesday, July 9, 13

slide-103
SLIDE 103

1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples

  • verhead in microseconds (bin size = 1.00us)

Linux 3.8.13: scheduling latency (no bg tasks) min=1.60us max=25.15us avg=2.82us median=2.65us stdev=0.47us samples: total=5854778

100

No Background Tasks

1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples Linux 3.8.13: scheduling latency (no bg tasks) min=1.52us max=19.73us avg=2.89us median=2.58us stdev=0.69us samples: total=5854801

avg=2.82μs max=25.15μs

Linux 3.8.13

avg=2.89μs max=19.73μs

Linux 3.8.13 threadirqs

100 Tuesday, July 9, 13

slide-104
SLIDE 104

1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples Linux 3.8.13: scheduling latency (CPU-bound bg tasks) min=2.14us max=64.47us avg=4.02us median=3.67us stdev=1.20us samples: total=5854707 1 10 100 1000 10000 100000 1e+06 1e+07 10 20 30 40 50 60 70 80 90 number of samples

  • verhead in microseconds (bin size = 1.00us)

Linux 3.8.13: scheduling latency (CPU-bound bg tasks) min=1.95us max=40.90us avg=3.67us median=3.29us stdev=1.19us samples: total=5854684

101

CPU-bound Background Tasks

avg=3.67μs max=40.90μs

Linux 3.8.13 threadirqs Linux 3.8.13

avg=4.02μs max=64.47μs

101 Tuesday, July 9, 13

slide-105
SLIDE 105

1 10 100 1000 10000 100000 1e+06 1e+07 150 300 450 600 750 900 1050 1200 1350 number of samples

  • verhead in microseconds (bin size = 1.00us)

Linux 3.8.13: scheduling latency (IO-bound bg tasks) min=1.51us max=5203.38us avg=5.89us median=4.67us stdev=14.33us samples: total=5854724 1 10 100 1000 10000 100000 1e+06 1e+07 150 300 450 600 750 900 1050 1200 1350 number of samples Linux 3.8.13: scheduling latency (IO-bound bg tasks) min=1.85us max=5464.07us avg=6.23us median=4.60us stdev=15.91us samples: total=5854773

102

I/O-bound Background Tasks

avg=5.89μs max=5203.38μs

Linux 3.8.13 threadirqs Linux 3.8.13

avg=6.23μs max=5464.07μs

102 Tuesday, July 9, 13