Fast on Average, Predictable in the Worst Case

Size: px
Start display at page:

Download "Fast on Average, Predictable in the Worst Case"

Transcription

1 Fast on Average, Predictable in the Worst Case Exploring Real-Time Futexes in LITMUSRT Roy Spliet, Manohar Vanga, Björn Brandenburg, Sven Dziadek IEEE Real-Time Systems Symposium 2014 December 2-5, 2014 Rome, Italy 1

2 Real-Time Locking API Mutex API kernel_do_lock(); // critical section kernel_do_unlock(); 2

3 Real-Time Locking API Mutex API kernel_do_lock(); // critical section kernel_do_unlock(); No other task is currently holding the lock No other task is waiting for the lock Operations are typically uncontended at runtime 3

4 Futexes: Fast Userspace Mutexes A mechanism (API) in the Linux kernel!! For optimizing the uncontended case of locking protocol implementations Avoid kernel invocation during uncontended operations 4

5 Futexes: Fast Userspace Mutexes A mechanism (API) in the Linux kernel!! For optimizing the uncontended case of locking protocol implementations Avoid kernel invocation during uncontended operations Why optimize the uncontended case?!! Improved throughput for soft real-time workloads Increasing available slack time in the system 5

6 Real-Time Locking Implementations PRIO_INHERIT! (Priority Inheritance Protocol) PRIO_PROTECT (Immediate Priority Ceiling Protocol) Classic Priority Ceiling Protocol! (PCP) Multiprocessor PCP (MPCP) FMLP Futex Implementation Linux 6

7 Real-Time Locking Implementations PRIO_INHERIT! (Priority Inheritance Protocol) PRIO_PROTECT (Immediate Priority Ceiling Protocol) Classic Priority Ceiling Protocol! (PCP) Multiprocessor PCP (MPCP) FMLP Futex Implementation Linux LITMUS RT LITMUS RT

8 Real-Time Locking Implementations PRIO_INHERIT! (Priority Inheritance Protocol) PRIO_PROTECT (Immediate Priority Ceiling Protocol) Classic Priority Ceiling Protocol! (PCP) Multiprocessor PCP (MPCP) FMLP Futex Implementation Linux LITMUS RT 8

9 Real-Time Locking Implementations PRIO_INHERIT! (Priority Inheritance Protocol) PRIO_PROTECT (Immediate Priority Ceiling Protocol) Classic Priority Ceiling Protocol! (PCP) Multiprocessor PCP (MPCP) FMLP Futex Implementation Linux LITMUS RT Choice between futex implementation and better analytical properties 9

10 Real-Time Locking Implementations PRIO_INHERIT! (Priority Inheritance Protocol) PRIO_PROTECT (Immediate Priority Ceiling Protocol) Classic Priority Ceiling Protocol! (PCP) Multiprocessor PCP (MPCP) FMLP Futex Implementation Linux LITMUS RT Choice between futex implementation and better analytical properties Why is it challenging to have both? 10

11 Real-Time Locking Implementations PRIO_INHERIT! (Priority Inheritance Protocol) PRIO_PROTECT (Immediate Priority Ceiling Protocol) Classic Priority Ceiling Protocol! (PCP) Multiprocessor PCP (MPCP) FMLP Futex Implementation Reactive Anticipatory 11

12 Real-Time Locking Protocol Dichotomy Reactive Locking Protocols Anticipatory Locking Protocols React to contention on a lock only when it occurs. Anticipate problem scenarios and take measure to minimize priority-inversion (pi) blocking. 12

13 Real-Time Locking Protocol Dichotomy Reactive Locking Protocols Anticipatory Locking Protocols React to contention on a lock only when it occurs. Anticipate problem scenarios and take measure to minimize priority-inversion (pi) blocking. Simple futex implementation Tricky to implement futexes without violating semantics 13

14 Contributions PRIO_INHERIT! (Priority Inheritance Protocol) PRIO_PROTECT (Immediate Priority Ceiling Protocol) Classic Priority Ceiling Protocol! (PCP) Multiprocessor PCP (MPCP) FMLP Futex Implementation 14

15 Contributions PRIO_INHERIT! (Priority Inheritance Protocol) PRIO_PROTECT (Immediate Priority Ceiling Protocol) Classic Priority Ceiling Protocol! (PCP) Multiprocessor PCP (MPCP) FMLP Futex Implementation Design and implementation of futexes for three anticipatory real-time locking protocols 15

16 Contributions PRIO_INHERIT! (Priority Inheritance Protocol) PRIO_PROTECT (Immediate Priority Ceiling Protocol) Classic Priority Ceiling Protocol! (PCP) Multiprocessor PCP (MPCP) FMLP Futex Implementation Observed overhead reduction: 92% 85% 84% Design and implementation of futexes for three anticipatory real-time locking protocols 16

17 Contributions PRIO_INHERIT! (Priority Inheritance Protocol) PRIO_PROTECT (Immediate Priority Ceiling Protocol) Classic Priority Ceiling Protocol! (PCP) Multiprocessor PCP (MPCP) FMLP Futex Implementation Observed overhead reduction: 92% 85% 84% Design and implementation of futexes for three anticipatory real-time locking protocols Method of using page faults to implement futexes 17

18 Overview of Talk 18

19 Overview of Talk Challenge Implementation Evaluation 19

20 Overview of Talk Challenge Implementation Evaluation 20

21 Futexes Overview and Intuition The problem with the vanilla approach Mutex API kernel_do_lock(); // critical section kernel_do_unlock(); 21

22 Futexes Overview and Intuition The problem with the vanilla approach Kernel invoked on every lock and unlock operation Mutex API kernel_do_lock(); // critical section kernel_do_unlock(); 22

23 Futexes Overview and Intuition The problem with the vanilla approach Kernel invoked on every lock and unlock operation Task Task Task Mutex API kernel_do_lock(); // critical section kernel_do_unlock(); Lock State Kernel 23

24 Futexes Overview and Intuition Exporting Lock State to Userspace Processes Task Task Task Lock State Kernel Shared lock state between userspace and kernel 24

25 Futexes Overview and Intuition Exporting Lock State to Userspace Processes Futex Pseudocode try_to_acquire_lock(lock); if (lock is contended) kernel_do_lock(lock); // critical section release_lock(lock); if (there are blocked tasks) kernel_do_unlock(); Task Task Task Lock State Kernel 25

26 Futexes Overview and Intuition Fast-Path for Uncontended Operations Futex Pseudocode try_to_acquire_lock(lock); if (lock is contended) kernel_do_lock(lock); // critical section release_lock(lock); if (there are blocked tasks) kernel_do_unlock(); Task Task Task Lock State Kernel Fast-path when operation is uncontended (kernel not invoked) 26

27 Futexes Overview and Intuition Slow-Path for Contended Operations Futex Pseudocode try_to_acquire_lock(lock); if (lock is contended) kernel_do_lock(lock); // critical section release_lock(lock); if (there are blocked tasks) kernel_do_unlock(); Task Task Task Lock State Kernel Kernel invoked only when lock or unlock operation is contended 27

28 Priority Inheritance Protocol Futexes for reactive locking protocols HI Lock 2 LO Lock 1 Lock 2 Time 28 Fixed-Priority Scheduling

29 Priority Inheritance Protocol Futexes for reactive locking protocols Uncontended No kernel intervention HI Lock 2 LO Lock 1 Lock 2 Time 29 Fixed-Priority Scheduling

30 Priority Inheritance Protocol Futexes for reactive locking protocols Uncontended No kernel intervention Contended Kernel intervention needed HI Lock 2 LO Lock 1 Lock 2 Time 30 Fixed-Priority Scheduling

31 Priority Ceiling Protocol (PCP) Each lock has a priority ceiling the highest priority of all tasks that can acquire that lock. System ceiling Currently held lock with highest ceiling A lock may be acquired by a task only if: Task priority > System Ceiling Priority! Or the task is holding the system ceiling! When under pi-blocking, priority inheritance raises priority of lower priority task to that of higher priority task. 31

32 Priority Ceiling Protocol (PCP) Each lock has a priority ceiling the highest priority of all tasks that can acquire that lock. System ceiling Currently held lock with highest ceiling A lock may be acquired by a task only if: Task priority > System Ceiling Priority! Or the task is holding the system ceiling! When under pi-blocking, priority inheritance raises priority of lower priority task to that of higher priority task. 32

33 Priority Ceiling Protocol (PCP) Each lock has a priority ceiling the highest priority of all tasks that can acquire that lock. System ceiling Currently held lock with highest ceiling A lock may be acquired by a task only if: Task priority > System Ceiling Priority! Or the task is holding the system ceiling! When under pi-blocking, priority inheritance raises priority of lower priority task to that of higher priority task. 33

34 Priority Ceiling Protocol (PCP) Each lock has a priority ceiling the highest priority of all tasks that can acquire that lock. System ceiling Currently held lock with highest ceiling A lock may be acquired by a task only if: Task priority > System Ceiling Priority! Or the task is holding the system ceiling! When under contention, priority inheritance (raises priority of lower priority task to that of higher priority task). 34

35 PCP Futexes Challenge HI L1 MED L2 LO L1 Time 35 Fixed-Priority Scheduling

36 PCP Futexes Challenge HI L1 MED L2 LO L1 Raises system ceiling prio. to HI Time Lowers system ceiling prio. to None 36 Fixed-Priority Scheduling

37 PCP Futexes Challenge HI L1 Valid acquisition MED > System Ceiling Prio. MED L2 LO L1 Raises system ceiling prio. to HI Time Lowers system ceiling prio. to None 37 Fixed-Priority Scheduling

38 PCP Futexes Challenge HI L1 HI L1 MED L2 MED L2 LO L1 LO L1 Time Time 38 Fixed-Priority Scheduling

39 PCP Futexes Challenge HI L1 HI L1 MED L2 MED L2 LO L1 LO L1 Time Raises system ceiling prio. to HI Time Preemption Sys. ceiling prio. = HI 39 Fixed-Priority Scheduling

40 PCP Futexes Challenge HI L1 HI L1 L2 free But invalid acquisition Sys. Ceiling Prio. > MED MED L2 MED L2 LO L1 LO L1 Time Raises system ceiling prio. to HI Time Preemption Sys. ceiling prio. = HI 40 Fixed-Priority Scheduling

41 PCP Futexes Challenge HI L1 HI L1 L2 free But invalid acquisition Sys. Ceiling Prio. > MED MED L2 MED L2 LO L1 LO L1 Problem Simply relying on lock state (as in reactive case) may violate PCP semantics. Must consider system ceiling. Time Time Raises system ceiling prio. to HI Preemption Sys. ceiling prio. = HI 41 Fixed-Priority Scheduling

42 PCP Futexes Challenge HI L1 HI L1 L2 free But invalid acquisition Sys. Ceiling Prio. > MED MED L2 MED L2 LO L1 LO L1 Problem Simply relying on lock state (as in reactive case) may violate PCP semantics. Must consider system ceiling. Time Time Raises system ceiling prio. to HI Problem system ceiling potentially updated at every Preemption lock acquisition and release must always invoke Sys. kernel ceiling to avoid prio. = HI protocol violations 42 Fixed-Priority Scheduling

43 Overview of Talk Challenge Implementation Evaluation 43

44 Overview of Talk Challenge Implementation Evaluation 44

45 PCP Futexes Our Approach PCP Futex Pseudocode if (lock is contended) kernel_do_lock(lock); else acquire_lock_locally(lock) // critical section release_lock(lock); if (there are blocked tasks) kernel_do_unlock(); 45

46 PCP Futexes Our Approach PCP Futex Pseudocode if (lock is contended) kernel_do_lock(lock); else acquire_lock_locally(lock) // critical section release_lock(lock); if (there are blocked tasks) kernel_do_unlock(); Whether lock acquisition is contended is determined in PCP by the current system ceiling 46

47 PCP Futexes Our Approach PCP Futex Pseudocode if (lock is contended) kernel_do_lock(lock); else acquire_lock_locally(lock) // critical section release_lock(lock); if (there are blocked tasks) kernel_do_unlock(); Whether lock acquisition is contended is determined in PCP by the current system ceiling The presence of blocked tasks is determined by the size of the waitqueue corresponding to the lock. 47

48 PCP Futexes Our Approach PCP Futex Pseudocode if (lock is contended) kernel_do_lock(lock); else acquire_lock_locally(lock) // critical section release_lock(lock); if (there are blocked tasks) kernel_do_unlock(); Whether lock acquisition is contended is determined in PCP by the current system ceiling The presence of blocked tasks is determined by the size of the waitqueue corresponding to the lock. Cannot change while a task is scheduled on a uniprocessor! 48

49 PCP Futexes Deferred Updates HI Scheduling Interval LO Time Invoke kernel 49

50 PCP Futexes Deferred Updates HI Scheduling Interval LO Time Predetermine contention conditions and communicate them to task Make changes to local copy of lock states (if uncontended) Update kernel state based on copy at context switch 50

51 PCP Futexes Deferred Updates HI Scheduling Interval LO Time Predetermine contention conditions and communicate them to task Make changes to local copy of lock states (if uncontended) Update kernel state based on copy at context switch Requires a bidirectional communication channel between tasks and the kernel 51

52 Bidirectional Communication Lock Page bitmap: lock_states bool: tasks_blocked Lock Page Per-process page of memory writable by both the process and kernel. 52

53 Bidirectional Communication Lock Page Lock-state bitmap used to communicate acquisitions and releases of locks to kernel bitmap: lock_states bool: tasks_blocked Lock Page Per-process page of memory writable by both the process and kernel. 53

54 Bidirectional Communication Lock Page Lock-state bitmap used to communicate acquisitions and releases of locks to kernel bitmap: lock_states bool: tasks_blocked Lock Page Per-process page of memory writable by both the process and kernel. Boolean set by kernel to indicate the presence of blocked tasks (indicates that release operation is contended) 54

55 Bidirectional Communication Lock Page Lock-state bitmap used to communicate acquisitions and releases of locks to kernel bitmap: lock_states bool: tasks_blocked Lock Page Per-process page of memory writable by both the process and kernel. Boolean set by kernel to indicate the presence of blocked tasks (indicates that release operation is contended) A permission bit set by the kernel to indicate whether lock acquisition is allowed (system ceiling check) 55

56 Communicating the Permission Bit PCP Futex Pseudocode if (permission bit is set) set_bit_in_bitmap(lock) else kernel_do_lock(lock); // critical section release_lock(lock); if (tasks_blocked is set) kernel_do_unlock(); 56

57 Communicating the Permission Bit PCP Futex Pseudocode if (permission bit is set) set_bit_in_bitmap(lock) else kernel_do_lock(lock); // critical section release_lock(lock); if (tasks_blocked is set) kernel_do_unlock(); Challenge: Checking for permission and setting lock bit must be atomic. Why? Preemption between them may change the permission. 57

58 Communicating the Permission Bit We proposed two approaches for the Classic PCP Page Faults (PCP-DU-PF) CMPXCHG (PCP-DU-BOOL) Uses page faults to invoke kernel when locking is prohibited Boolean for permission bit. Compare-and-exchange operation to check and acquire locks atomically 58

59 Communicating the Permission Bit We proposed two approaches for the Classic PCP Page Faults (PCP-DU-PF) CMPXCHG (PCP-DU-BOOL) Uses page faults to invoke kernel when locking is prohibited Boolean See paper for! details! Compare-and-exchange operation to check and acquire locks atomically

60 PCP Futexes Page Fault Approach HI LO Time If (locking is allowed) set lock page writable else set lock page unwritable Attempting to write lock bit will invoke kernel automatically if locking is not permitted 60

61 PCP Futexes Page Fault Approach Can be implemented using segmentation faults as well HI Lock code-path is entirely branch-free LO Time If (locking is allowed) set lock page writable else set lock page unwritable Attempting to write lock bit will invoke kernel automatically if locking is not permitted 61

62 PCP Futexes Page Fault Approach Can be implemented using segmentation faults as well HI Lock code-path is entirely branch-free LO Requires an optimized page-fault handler Time If (locking is allowed) set lock page writable else set lock page unwritable Attempting to write lock bit will invoke kernel automatically if locking is not permitted 62

63 Communicating the Permission Bit We proposed two approaches for the Classic PCP Page Faults (PCP-DU-PF) CMPXCHG (PCP-DU-BOOL) Uses page faults to invoke kernel when locking is prohibited Boolean for permission bit. Compare-and-exchange operation to check and acquire locks atomically Lock code-path is entirely branch-free Avoid page faults at cost of atomic op + branch 63

64 Overview of Talk Challenge Implementation Evaluation 64

65 Overview of Talk Challenge Implementation Evaluation 65

66 Evaluation Platform Boundary Devices Sabre Lite Board Freescale I.MX6Q Quad Core SoC ARM Cortex A9 (1 GHz) Implemented in LITMUS RT (based on Linux ) 66

67 Evaluation Benchmarking Methodology Test program locks and unlocks once every period Uniprocessor tests: 5 threads Randomly assigned parameters for threads Critical section length 25-45µs Execution time 25-65µs Period µs Measured using processor timestamp counters 67

68 Evaluation Benchmarking Methodology Test program locks and unlocks once every period Uniprocessor tests: 5 threads Randomly assigned parameters for threads Critical section length 25-45µs Execution time 25-65µs Period µs Demanding workload thousands of operations per second Measured using processor timestamp counters 68

69 PCP Futex Evaluation Baseline We compare all futex implementations against the non-futex PCP implementation in LITMUS RT PRIO_INHERIT! (Priority Inheritance Protocol) PRIO_PROTECT (Immediate Priority Ceiling Protocol) Classic Priority Ceiling Protocol! (PCP) Multiprocessor PCP (MPCP) FMLP Futex Implementation Linux LITMUS RT 69

70 PCP Futex Evaluation Baseline PRIO_PROTECT (Linux PCP) PCP (LITMUS^RT) 33,271 Overhead in Cycles 1, ,850 1,221 1,211 9,027 6,655 Lock (avg) Lock (max) Unlock (avg) Unlock (max) 70

71 PCP Futex Evaluation Baseline PRIO_PROTECT (Linux PCP) PCP (LITMUS^RT) Overhead in Cycles 1, ,271 Our baseline PCP implementation already incurs lower overheads than Linux s. 3,850 1,221 1,211 9,027 6,655 Lock (avg) Lock (max) Unlock (avg) Unlock (max) 71

72 PCP Futex Evaluation Uncontended Case How much reduction do we see in average uncontended-case overheads? 72

73 PCP Futex Evaluation Uncontended Case Lock (average) Unlock (average) 100% 100% Overhead (compared to baseline) 25% 27% 41% 25% 7% 8% PCP (LITMUS^RT) ) Futex PCP (Page-Faults) Futex Futex PCP (CMPXCHG) Futex PRIO_INHERIT Linux Futex (Linux) Baseline (Page Faults) (CMPXCHG) (PRIO_INHERIT) Based on 6.6 million samples per protocol 73

74 PCP Futex Evaluation Uncontended Case Lock (average) Unlock (average) 100% 100% Overhead (compared to baseline) Our PCP futex implementation overheads are significantly lower than Linux s PIP futex implementation. 25% 7% 27% 8% 41% 25% PCP (LITMUS^RT) ) Futex PCP (Page-Faults) Futex Futex PCP (CMPXCHG) Futex PRIO_INHERIT Linux Futex (Linux) Baseline (Page Faults) (CMPXCHG) (PRIO_INHERIT) Based on 6.6 million samples per protocol 74

75 PCP Futex Evaluation Contended Case How much additional overhead do we incur in the maximum contended-case overheads? 75

76 PCP Futex Evaluation Contended Case Lock (Max) Unlock (Max) 186% 167% 137% 100% 100% 107% 106% 106% PCP PCP (LITMUS^RT) ) PCP-DU-PF Futex PCP-DU-BOOL Futex PRIO_INHERIT Linux Futex (Linux) Baseline (Page Faults) (CMPXCHG) (PRIO_INHERIT) 76 Based on 900K samples per protocol

77 PCP Futex Evaluation Contended Case Lock (Max) Unlock (Max) Linux page-fault handler not optimized for real-time locking protocol implementation. 186% 137% 167% 100% 100% 107% 106% 106% PCP PCP (LITMUS^RT) ) PCP-DU-PF Futex PCP-DU-BOOL Futex PRIO_INHERIT Linux Futex (Linux) Baseline (Page Faults) (CMPXCHG) (PRIO_INHERIT) 77 Based on 900K samples per protocol

78 PCP Futex Evaluation Contended Case Lock (Max) Unlock (Max) 186% 167% 137% 107% 100% 100% 106% 106% PCP-DU-PF PCP (LITMUS^RT) ) PCP-DU-BOOL Futex PRIO_INHERIT Linux Futex (Linux) Baseline (CMPXCHG) (PRIO_INHERIT) 78 Based on 900K samples per protocol

79 PCP Futex Evaluation Contended Case Lock (Max) Unlock (Max) Up to 37% 186% increase in worst-case contended overheads as a result of the futex approach. 137% 167% 107% 100% 100% 106% 106% PCP-DU-PF PCP (LITMUS^RT) ) PCP-DU-BOOL Futex PRIO_INHERIT Linux Futex (Linux) Baseline (CMPXCHG) (PRIO_INHERIT) 79 Based on 900K samples per protocol

80 PCP Futex Evaluation Contended Case Lock (Max) Unlock (Max) Up to 37% 186% increase in worst-case contended overheads as a result of the futex approach. But no worse than Linux s futex implementation 107% 100% 100% 137% 106% 167% 106% PCP-DU-PF PCP (LITMUS^RT) ) PCP-DU-BOOL Futex PRIO_INHERIT Linux Futex (Linux) Baseline (CMPXCHG) (PRIO_INHERIT) 80 Based on 900K samples per protocol

81 PCP Futex Evaluation Summary Up to 92% reduction in average uncontended overheads at a cost of 37% increase in maximum contended overheads (no worse than Linux). Page faults can be used to implement futexes for anticipatory real-time locking protocols. 81

82 Summary PRIO_INHERIT! (Priority Inheritance Protocol) PRIO_PROTECT (Immediate Priority Ceiling Protocol) Classic Priority Ceiling Protocol! (PCP) Multiprocessor PCP (MPCP) FMLP Futex Implementation Observed overhead reduction: 92% 85% 84% Design and implementation of futexes for three anticipatory real-time locking protocols Method of using page faults to implement futexes 82

83 Thanks! Linux Testbed for Multiprocessor Scheduling in Real-Time Systems All source code available at: 83

Fast on Average, Predictable in the Worst Case: Exploring Real-Time Futexes in LITMUS RT

Fast on Average, Predictable in the Worst Case: Exploring Real-Time Futexes in LITMUS RT Fast on Average, Predictable in the Worst Case: Exploring Real-Time Futexes in LITMUS RT Roy Spliet MPI-SWS Manohar Vanga MPI-SWS Björn B. Brandenburg MPI-SWS Sven Dziadek TU Dresden Abstract This paper

More information

Efficient Implementation of IPCP and DFP

Efficient Implementation of IPCP and DFP Efficient Implementation of IPCP and DFP N.C. Audsley and A. Burns Department of Computer Science, University of York, York, UK. email: {neil.audsley, alan.burns}@york.ac.uk Abstract Most resource control

More information

A Fully Preemptive Multiprocessor Semaphore Protocol for Latency-Sensitive Real-Time Applications

A Fully Preemptive Multiprocessor Semaphore Protocol for Latency-Sensitive Real-Time Applications A Fully Preemptive Multiprocessor Semaphore Protocol for Latency-Sensitive Real-Time Applications ECRTS 13 July 12, 2013 Björn B. bbb@mpi-sws.org A Rhetorical Question On uniprocessors, why do we use the

More information

A Comparison of Scheduling Latency in Linux, PREEMPT_RT, and LITMUS RT. Felipe Cerqueira and Björn Brandenburg

A Comparison of Scheduling Latency in Linux, PREEMPT_RT, and LITMUS RT. Felipe Cerqueira and Björn Brandenburg A Comparison of Scheduling Latency in Linux, PREEMPT_RT, and LITMUS RT Felipe Cerqueira and Björn Brandenburg July 9th, 2013 1 Linux as a Real-Time OS 2 Linux as a Real-Time OS Optimizing system responsiveness

More information

Measuring the impacts of the Preempt-RT patch

Measuring the impacts of the Preempt-RT patch Measuring the impacts of the Preempt-RT patch maxime.chevallier@smile.fr October 25, 2017 RT Linux projects Simulation platform : bi-xeon, lots ot RAM 200µs wakeup latency, networking Test bench : Intel

More information

A Synchronous IPC Protocol for Predictable Access to Shared Resources in Mixed-Criticality Systems

A Synchronous IPC Protocol for Predictable Access to Shared Resources in Mixed-Criticality Systems A Synchronous IPC Protocol for Predictable Access to Shared Resources in Mixed-Criticality Systems RTSS 14 December 4, 2014 Björn B. bbb@mpi-sws.org Linux Testbed for Multiprocessor Scheduling in Real-Time

More information

Real Time Linux patches: history and usage

Real Time Linux patches: history and usage Real Time Linux patches: history and usage Presentation first given at: FOSDEM 2006 Embedded Development Room See www.fosdem.org Klaas van Gend Field Application Engineer for Europe Why Linux in Real-Time

More information

An Evaluation of the Dynamic and Static Multiprocessor Priority Ceiling Protocol and the Multiprocessor Stack Resource Policy in an SMP System

An Evaluation of the Dynamic and Static Multiprocessor Priority Ceiling Protocol and the Multiprocessor Stack Resource Policy in an SMP System An Evaluation of the Dynamic and Static Multiprocessor Priority Ceiling Protocol and the Multiprocessor Stack Resource Policy in an SMP System Jim Ras and Albert Mo Kim Cheng Outline Handling shared resources

More information

How Linux RT_PREEMPT Works

How Linux RT_PREEMPT Works How Linux RT_PREEMPT Works A common observation about real time systems is that the cost of the increased determinism of real time is decreased throughput and increased average latency. This presentation

More information

Adaptive Clustered EDF in LITMUS RT

Adaptive Clustered EDF in LITMUS RT Adaptive Clustered EDF in LITMUS RT Aaron Block,. Sherman, Texas William Kelley, BAE Systems. Ft. Worth, Texas Adaptable System: Whisper Whisper is a motion tracking system Speakers are placed on users

More information

Requeue PI: Making Glibc Condvars PI Aware

Requeue PI: Making Glibc Condvars PI Aware Requeue PI: Making Glibc Condvars PI Aware Darren Hart Special Thanks: Thomas Gleixner and Dinakar Guniguntala IBM Linux Technology Center Agenda Introduction Condvars Futexes Failure Cases Disorderly

More information

A Server-based Approach for Predictable GPU Access Control

A Server-based Approach for Predictable GPU Access Control A Server-based Approach for Predictable GPU Access Control Hyoseung Kim * Pratyush Patel Shige Wang Raj Rajkumar * University of California, Riverside Carnegie Mellon University General Motors R&D Benefits

More information

Implementation and Evaluation of the Synchronization Protocol Immediate Priority Ceiling in PREEMPT-RT Linux

Implementation and Evaluation of the Synchronization Protocol Immediate Priority Ceiling in PREEMPT-RT Linux Implementation and Evaluation of the Synchronization Protocol Immediate Priority Ceiling in PREEMPT-RT Linux Andreu Carminati, Rômulo Silva de Oliveira, Luís Fernando Friedrich, Rodrigo Lange Federal University

More information

Real-Time Technology in Linux

Real-Time Technology in Linux Real-Time Technology in Linux Sven-Thorsten Dietrich Real-Time Architect Introductions MontaVista Software is a leading global supplier of systems software and development tools for intelligent connected

More information

Improved Analysis and Evaluation of Real-Time Semaphore Protocols for P-FP Scheduling

Improved Analysis and Evaluation of Real-Time Semaphore Protocols for P-FP Scheduling Improved Analysis and Evaluation of Real-Time Semaphore Protocols for P-FP Scheduling RTAS 13 April 10, 2013 Björn B. bbb@mpi-sws.org Semaphores + P-FP Scheduling Used in practice: VxWorks, QNX, ThreadX,

More information

Empirical Approximation and Impact on Schedulability

Empirical Approximation and Impact on Schedulability Cache-Related Preemption and Migration Delays: Empirical Approximation and Impact on Schedulability OSPERT 2010, Brussels July 6, 2010 Andrea Bastoni University of Rome Tor Vergata Björn B. Brandenburg

More information

Analysis and Implementation of Global Preemptive Fixed-Priority Scheduling with Dynamic Cache Allocation

Analysis and Implementation of Global Preemptive Fixed-Priority Scheduling with Dynamic Cache Allocation Analysis and Implementation of Global Preemptive Fixed-Priority Scheduling with Dynamic Cache Allocation Meng Xu Linh Thi Xuan Phan Hyon-Young Choi Insup Lee Department of Computer and Information Science

More information

Requeue PI: Making Glibc Condvars PI Aware

Requeue PI: Making Glibc Condvars PI Aware Requeue PI: Making Glibc Condvars PI Aware Darren Hart Special Thanks: Thomas Gleixner and Dinakar Guniguntala Agenda Introduction Test System Specifications Condvars 8 Way Intel Blade Futexes 2 socket

More information

EECS 571 Principles of Real-Time Embedded Systems. Lecture Note #10: More on Scheduling and Introduction of Real-Time OS

EECS 571 Principles of Real-Time Embedded Systems. Lecture Note #10: More on Scheduling and Introduction of Real-Time OS EECS 571 Principles of Real-Time Embedded Systems Lecture Note #10: More on Scheduling and Introduction of Real-Time OS Kang G. Shin EECS Department University of Michigan Mode Changes Changes in mission

More information

Predictable Interrupt Management and Scheduling in the Composite Component-based System

Predictable Interrupt Management and Scheduling in the Composite Component-based System Predictable Interrupt Management and Scheduling in the Composite Component-based System Gabriel Parmer and Richard West Computer Science Department Boston University Boston, MA 02215 {gabep1, richwest}@cs.bu.edu

More information

AUTOBEST: A United AUTOSAR-OS And ARINC 653 Kernel. Alexander Züpke, Marc Bommert, Daniel Lohmann

AUTOBEST: A United AUTOSAR-OS And ARINC 653 Kernel. Alexander Züpke, Marc Bommert, Daniel Lohmann AUTOBEST: A United AUTOSAR-OS And ARINC 653 Kernel Alexander Züpke, Marc Bommert, Daniel Lohmann alexander.zuepke@hs-rm.de, marc.bommert@hs-rm.de, lohmann@cs.fau.de Motivation Automotive and Avionic industry

More information

Final Examination. Thursday, December 3, :20PM 620 PM. NAME: Solutions to Selected Problems ID:

Final Examination. Thursday, December 3, :20PM 620 PM. NAME: Solutions to Selected Problems ID: CSE 237B EMBEDDED SOFTWARE, FALL 2009 PROF. RAJESH GUPTA Final Examination Thursday, December 3, 2009 5:20PM 620 PM NAME: Solutions to Selected Problems ID: Problem Max. Points Points 1 20 2 25 3 35 4

More information

Verification of Real-Time Systems Resource Sharing

Verification of Real-Time Systems Resource Sharing Verification of Real-Time Systems Resource Sharing Jan Reineke Advanced Lecture, Summer 2015 Resource Sharing So far, we have assumed sets of independent tasks. However, tasks may share resources to communicate

More information

Linux Kernel Futex Fun: Exploiting CVE Dougall Johnson

Linux Kernel Futex Fun: Exploiting CVE Dougall Johnson Linux Kernel Futex Fun: Exploiting CVE-2014-3153 Dougall Johnson Overview Futex system call Kernel implementation CVE-2014-3153 My approach to exploiting it Futexes Fast user-space mutexes 32-bit integer

More information

Deterministic Futexes Revisited

Deterministic Futexes Revisited A. Zuepke Deterministic Futexes Revisited Alexander Zuepke, Robert Kaiser first.last@hs-rm.de A. Zuepke Futexes Futexes: underlying mechanism for thread synchronization in Linux libc provides: Mutexes

More information

Characterizing the Performance and Energy Efficiency of Lock-Free Data Structures

Characterizing the Performance and Energy Efficiency of Lock-Free Data Structures Characterizing the Performance and Energy Efficiency of Lock-Free Data Structures Nicholas Hunt Paramjit Singh Sandhu Luis Ceze University of Washington {nhunt,paramsan,luisceze}@cs.washington.edu Abstract

More information

A Comparison of the M-PCP, D-PCP, and FMLP on LITMUS RT

A Comparison of the M-PCP, D-PCP, and FMLP on LITMUS RT A Comparison of the M-PCP, D-PCP, and FMLP on LITMUS RT Björn B. Brandenburg and James H. Anderson The University of North Carolina at Chapel Hill Dept. of Computer Science Chapel Hill, NC 27599-375 USA

More information

Computer Science Window-Constrained Process Scheduling for Linux Systems

Computer Science Window-Constrained Process Scheduling for Linux Systems Window-Constrained Process Scheduling for Linux Systems Richard West Ivan Ganev Karsten Schwan Talk Outline Goals of this research DWCS background DWCS implementation details Design of the experiments

More information

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Computer Systems Engineering: Spring Quiz I Solutions

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Computer Systems Engineering: Spring Quiz I Solutions Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.033 Computer Systems Engineering: Spring 2011 Quiz I Solutions There are 10 questions and 12 pages in this

More information

Exam Review TexPoint fonts used in EMF.

Exam Review TexPoint fonts used in EMF. Exam Review Generics Definitions: hard & soft real-time Task/message classification based on criticality and invocation behavior Why special performance measures for RTES? What s deadline and where is

More information

CHAPTER 6: PROCESS SYNCHRONIZATION

CHAPTER 6: PROCESS SYNCHRONIZATION CHAPTER 6: PROCESS SYNCHRONIZATION The slides do not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams. TOPICS Background

More information

Multiprocessors and Locking

Multiprocessors and Locking Types of Multiprocessors (MPs) Uniform memory-access (UMA) MP Access to all memory occurs at the same speed for all processors. Multiprocessors and Locking COMP9242 2008/S2 Week 12 Part 1 Non-uniform memory-access

More information

Kernels and Locking. Luca Abeni

Kernels and Locking. Luca Abeni Kernels and Locking Luca Abeni luca.abeni@santannapisa.it Critical Sections in Kernel Code Old Linux kernels used to be non-preemptable... Kernel Big critical section Mutual exclusion was not a problem...

More information

REPORT DOCUMENTATION PAGE Form Approved OMB NO

REPORT DOCUMENTATION PAGE Form Approved OMB NO REPORT DOCUMENTATION PAGE Form Approved OMB NO. 0704-0188 The public reporting burden for this collection of information is estimated to average 1 hour per response, including the time for reviewing instructions,

More information

User-level threads. with threads. Paul Turner

User-level threads. with threads. Paul Turner User-level threads with threads. Paul Turner Threading Models 1:1 (Kernel Threading) User contexts correspond directly with their own kernel schedulable entity. Everything does this (e.g.

More information

Implementation and Evaluation of the Synchronization Protocol Immediate Priority Ceiling in PREEMPT-RT Linux

Implementation and Evaluation of the Synchronization Protocol Immediate Priority Ceiling in PREEMPT-RT Linux Implementation and Evaluation of the Synchronization Protocol Immediate Priority Ceiling in PREEMPT-RT Linux Andreu Carminati, Rômulo Silva de Oliveira, Luís Fernando Friedrich, Rodrigo Lange Federal University

More information

LITMUS RT : A Hands-On Primer

LITMUS RT : A Hands-On Primer LITMUS RT : A Hands-On Primer Manohar Vanga, Mahircan Gül, Björn Brandenburg MPI-SWS, Kaiserslautern, Germany Goals A whirlwind tour of LITMUS RT Working with scheduler plugins. Running real-time tasks

More information

Schedulability with resource sharing. Priority inheritance protocol Priority ceiling protocol Stack resource policy

Schedulability with resource sharing. Priority inheritance protocol Priority ceiling protocol Stack resource policy Schedulability with resource sharing Priority inheritance protocol Priority ceiling protocol Stack resource policy 1 Lecture overview We have discussed the occurrence of unbounded priority inversion We

More information

Commercial Real-time Operating Systems An Introduction. Swaminathan Sivasubramanian Dependable Computing & Networking Laboratory

Commercial Real-time Operating Systems An Introduction. Swaminathan Sivasubramanian Dependable Computing & Networking Laboratory Commercial Real-time Operating Systems An Introduction Swaminathan Sivasubramanian Dependable Computing & Networking Laboratory swamis@iastate.edu Outline Introduction RTOS Issues and functionalities LynxOS

More information

Lecture 10: Avoiding Locks

Lecture 10: Avoiding Locks Lecture 10: Avoiding Locks CSC 469H1F Fall 2006 Angela Demke Brown (with thanks to Paul McKenney) Locking: A necessary evil? Locks are an easy to understand solution to critical section problem Protect

More information

Multi-Resource Real-Time Reader/Writer Locks for Multiprocessors

Multi-Resource Real-Time Reader/Writer Locks for Multiprocessors Multi-Resource Real-Time Reader/Writer Locks for Multiprocessors Bryan C. Ward and James H. Anderson Dept. of Computer Science, The University of North Carolina at Chapel Hill Abstract A fine-grained locking

More information

MULTI SLOTH: An Efficient Multi-Core RTOS using Hardware-Based Scheduling

MULTI SLOTH: An Efficient Multi-Core RTOS using Hardware-Based Scheduling MULTI SLOTH: An Efficient Multi-Core RTOS using Hardware-Based Scheduling Rainer Müller, Daniel Danner, Wolfgang Schröder-Preikschat, Daniel Lohmann Friedrich Alexander Universität (FAU) Erlangen Nürnberg,

More information

An implementation of the flexible spin-lock model in ERIKA Enterprise on a multi-core platform

An implementation of the flexible spin-lock model in ERIKA Enterprise on a multi-core platform An implementation of the flexible spin-lock model in ERIKA Enterprise on a multi-core platform Sara Afshar 1, Maikel P.W. Verwielen 2, Paolo Gai 3, Moris Behnam 1, Reinder J. Bril 1,2 1 Mälardalen University,

More information

Data Processing on Modern Hardware

Data Processing on Modern Hardware Data Processing on Modern Hardware Jens Teubner, TU Dortmund, DBIS Group jens.teubner@cs.tu-dortmund.de Summer 2014 c Jens Teubner Data Processing on Modern Hardware Summer 2014 1 Part V Execution on Multiple

More information

Microkernel/OS and Real-Time Scheduling

Microkernel/OS and Real-Time Scheduling Chapter 12 Microkernel/OS and Real-Time Scheduling Hongwei Zhang http://www.cs.wayne.edu/~hzhang/ Ack.: this lecture is prepared in part based on slides of Lee, Sangiovanni-Vincentelli, Seshia. Outline

More information

Department of Computer Science, Institute for System Architecture, Operating Systems Group. Real-Time Systems '08 / '09. Hardware.

Department of Computer Science, Institute for System Architecture, Operating Systems Group. Real-Time Systems '08 / '09. Hardware. Department of Computer Science, Institute for System Architecture, Operating Systems Group Real-Time Systems '08 / '09 Hardware Marcus Völp Outlook Hardware is Source of Unpredictability Caches Pipeline

More information

Implementation and Evaluation of the Synchronization Protocol Immediate Priority Ceiling in PREEMPT-RT Linux

Implementation and Evaluation of the Synchronization Protocol Immediate Priority Ceiling in PREEMPT-RT Linux 516 JOURNAL OF SOFTWARE, VOL. 7, NO. 3, MARCH 2012 Implementation and Evaluation of the Synchronization Protocol Immediate Priority Ceiling in PREEMPT-RT Linux Andreu Carminati Department of Automation

More information

An Implementation of the PCP, SRP, D-PCP, M-PCP, and FMLP Real-Time Synchronization Protocols in LITMUS RT

An Implementation of the PCP, SRP, D-PCP, M-PCP, and FMLP Real-Time Synchronization Protocols in LITMUS RT An Implementation of the PCP, SRP, D-PCP, M-PCP, and FMLP Real-Time Synchronization Protocols in LITMUS RT Björn B. Brandenburg and James H. Anderson The University of North Carolina at Chapel Hill Abstract

More information

Overview. Sporadic tasks. Recall. Aperiodic tasks. Real-time Systems D0003E 2/26/2009. Loosening D = T. Aperiodic tasks. Response-time analysis

Overview. Sporadic tasks. Recall. Aperiodic tasks. Real-time Systems D0003E 2/26/2009. Loosening D = T. Aperiodic tasks. Response-time analysis Overview Real-time Systems D0003E Lecture 11: Priority inversion Burns/Wellings ch. 13 (except 13.12) Aperiodic tasks Response time analysis Blocking Priority inversion Priority inheritance Priority ceiling

More information

EE458 - Embedded Systems Lecture 8 Semaphores

EE458 - Embedded Systems Lecture 8 Semaphores EE458 - Embedded Systems Lecture 8 Semaphores Outline Introduction to Semaphores Binary and Counting Semaphores Mutexes Typical Applications RTEMS Semaphores References RTC: Chapter 6 CUG: Chapter 9 1

More information

CS420: Operating Systems. Process Synchronization

CS420: Operating Systems. Process Synchronization Process Synchronization James Moscola Department of Engineering & Computer Science York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne Background

More information

CSE 4/521 Introduction to Operating Systems

CSE 4/521 Introduction to Operating Systems CSE 4/521 Introduction to Operating Systems Lecture 7 Process Synchronization II (Classic Problems of Synchronization, Synchronization Examples) Summer 2018 Overview Objective: 1. To examine several classical

More information

Realtime BoF Session RealTime Testing Best Practice of RealTime WG YungJoon Jung

Realtime BoF Session RealTime Testing Best Practice of RealTime WG YungJoon Jung Realtime BoF Session RealTime Testing Best Practice of RealTime WG YungJoon Jung April 15th, 2008 CE Linux Forum 1 Contents Introduction Current RealTime Testing Methods Plan April 15th, 2008 CE Linux

More information

Supporting Time-sensitive Applications on a Commodity OS

Supporting Time-sensitive Applications on a Commodity OS Supporting Time-sensitive Applications on a Commodity OS Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Department of Computer Science and Engineering Oregon Graduate Institute, Portland

More information

EXTENDING THE PRIORITY CEILING PROTOCOL USING READ/WRITE AFFECTED SETS MICHAEL A. SQUADRITO A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE

EXTENDING THE PRIORITY CEILING PROTOCOL USING READ/WRITE AFFECTED SETS MICHAEL A. SQUADRITO A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE EXTENDING THE PRIORITY CEILING PROTOCOL USING READ/WRITE AFFECTED SETS BY MICHAEL A. SQUADRITO A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE IN COMPUTER

More information

Using Software Transactional Memory In Interrupt-Driven Systems

Using Software Transactional Memory In Interrupt-Driven Systems Using Software Transactional Memory In Interrupt-Driven Systems Department of Mathematics, Statistics, and Computer Science Marquette University Thesis Defense Introduction Thesis Statement Software transactional

More information

A Flexible Multiprocessor Resource Sharing Framework for Ada

A Flexible Multiprocessor Resource Sharing Framework for Ada A Flexible Multiprocessor Resource Sharing Framework for Ada Shiyao Lin Submitted for the Degree of Doctor of Philosophy University of York Department of Computer Science September 2013 Abstract Lock-based

More information

Multiprocessor Real-Time Locking Protocols: from Homogeneous to Heterogeneous

Multiprocessor Real-Time Locking Protocols: from Homogeneous to Heterogeneous Multiprocessor Real-Time Locking Protocols: from Homogeneous to Heterogeneous Kecheng Yang Department of Computer Science, University of North Carolina at Chapel Hill Abstract In this project, we focus

More information

Evaluation of Real-time Performance in Embedded Linux. Hiraku Toyooka, Hitachi. LinuxCon Europe Hitachi, Ltd All rights reserved.

Evaluation of Real-time Performance in Embedded Linux. Hiraku Toyooka, Hitachi. LinuxCon Europe Hitachi, Ltd All rights reserved. Evaluation of Real-time Performance in Embedded Linux LinuxCon Europe 2014 Hiraku Toyooka, Hitachi 1 whoami Hiraku Toyooka Software engineer at Hitachi " Working on operating systems Linux (mainly) for

More information

Reducing Priority Inversion in Interprocessor Synchronization on a Fixed-Priority Bus

Reducing Priority Inversion in Interprocessor Synchronization on a Fixed-Priority Bus Reducing Priority Inversion in Interprocessor Synchronization on a Fixed-Priority Bus Chi-Sing Chen (cschen@cs.fsu.edu) Pratit Santiprabhob (pratit@cs.fsu.edu) T.P. Baker (baker@cs.fsu.edu) Department

More information

Final Exam Preparation Questions

Final Exam Preparation Questions EECS 678 Spring 2013 Final Exam Preparation Questions 1 Chapter 6 1. What is a critical section? What are the three conditions to be ensured by any solution to the critical section problem? 2. The following

More information

Locking: A necessary evil? Lecture 10: Avoiding Locks. Priority Inversion. Deadlock

Locking: A necessary evil? Lecture 10: Avoiding Locks. Priority Inversion. Deadlock Locking: necessary evil? Lecture 10: voiding Locks CSC 469H1F Fall 2006 ngela Demke Brown (with thanks to Paul McKenney) Locks are an easy to understand solution to critical section problem Protect shared

More information

Resource Sharing among Prioritized Real-Time Applications on Multiprocessors

Resource Sharing among Prioritized Real-Time Applications on Multiprocessors Resource Sharing among Prioritized Real-Time Applications on Multiprocessors Sara Afshar, Nima Khalilzad, Farhang Nemati, Thomas Nolte Email: sara.afshar@mdh.se MRTC, Mälardalen University, Sweden ABSTRACT

More information

Improve Linux User-Space Core Libraries with Restartable Sequences

Improve Linux User-Space Core Libraries with Restartable Sequences Open Source Summit 2018 Improve Linux User-Space Core Libraries with Restartable Sequences mathieu.desnoyers@efcios.com Speaker Mathieu Desnoyers CEO at EfficiOS Inc. Maintainer of: LTTng kernel and user-space

More information

CS140 Operating Systems Midterm Review. Feb. 5 th, 2009 Derrick Isaacson

CS140 Operating Systems Midterm Review. Feb. 5 th, 2009 Derrick Isaacson CS140 Operating Systems Midterm Review Feb. 5 th, 2009 Derrick Isaacson Midterm Quiz Tues. Feb. 10 th In class (4:15-5:30 Skilling) Open book, open notes (closed laptop) Bring printouts You won t have

More information

1) If a location is initialized to 0, what will the first invocation of TestAndSet on that location return?

1) If a location is initialized to 0, what will the first invocation of TestAndSet on that location return? Synchronization Part 1: Synchronization - Locks Dekker s Algorithm and the Bakery Algorithm provide software-only synchronization. Thanks to advancements in hardware, synchronization approaches have been

More information

DYNAMIC MEMORY ALLOCATION ON REAL-TIME LINUX

DYNAMIC MEMORY ALLOCATION ON REAL-TIME LINUX DYNAMIC MEMORY ALLOCATION ON REAL-TIME LINUX Jianping Shen Institut Dr. Foerster GmbH und Co. KG In Laisen 70, 72766, Reutlingen, Germany shen.jianping@foerstergroup.de Michael Hamal Institut Dr. Foerster

More information

Hardware Locks for a Real-Time Java Chip-Multiprocessor

Hardware Locks for a Real-Time Java Chip-Multiprocessor CONCURRENCY AND COMPUTATION: PRACTICE AND EXPERIENCE Concurrency Computat.: Pract. Exper. 0000; 00:1 22 Published online in Wiley InterScience (www.interscience.wiley.com). Hardware Locks for a Real-Time

More information

CS4514 Real Time Scheduling

CS4514 Real Time Scheduling CS4514 Real Time Scheduling Jose M. Garrido Fall 2015 Department of Computer Science 1 Periodic Tasks Typical real-time application has many tasks that need to be executed periodically Reading sensor data

More information

Multiprocessor System. Multiprocessor Systems. Bus Based UMA. Types of Multiprocessors (MPs) Cache Consistency. Bus Based UMA. Chapter 8, 8.

Multiprocessor System. Multiprocessor Systems. Bus Based UMA. Types of Multiprocessors (MPs) Cache Consistency. Bus Based UMA. Chapter 8, 8. Multiprocessor System Multiprocessor Systems Chapter 8, 8.1 We will look at shared-memory multiprocessors More than one processor sharing the same memory A single CPU can only go so fast Use more than

More information

A Server-based Approach for Predictable GPU Access with Improved Analysis

A Server-based Approach for Predictable GPU Access with Improved Analysis A Server-based Approach for Predictable GPU Access with Improved Analysis Hyoseung Kim 1, Pratyush Patel 2, Shige Wang 3, and Ragunathan (Raj) Rajkumar 4 1 University of California, Riverside, hyoseung@ucr.edu

More information

Deadlock. Lecture 4: Synchronization & Communication - Part 2. Necessary conditions. Deadlock handling. Hierarchical resource allocation

Deadlock. Lecture 4: Synchronization & Communication - Part 2. Necessary conditions. Deadlock handling. Hierarchical resource allocation Lecture 4: Synchronization & ommunication - Part 2 [RTS h 4] Deadlock Priority Inversion & Inheritance Mailbox ommunication ommunication with Objects Deadlock Improper allocation of common resources may

More information

Multiprocessor Systems. COMP s1

Multiprocessor Systems. COMP s1 Multiprocessor Systems 1 Multiprocessor System We will look at shared-memory multiprocessors More than one processor sharing the same memory A single CPU can only go so fast Use more than one CPU to improve

More information

Advanced Topic: Efficient Synchronization

Advanced Topic: Efficient Synchronization Advanced Topic: Efficient Synchronization Multi-Object Programs What happens when we try to synchronize across multiple objects in a large program? Each object with its own lock, condition variables Is

More information

The need for atomicity This code sequence illustrates the need for atomicity. Explain.

The need for atomicity This code sequence illustrates the need for atomicity. Explain. Lock Implementations [ 8.1] Recall the three kinds of synchronization from Lecture 6: Point-to-point Lock Performance metrics for lock implementations Uncontended latency Traffic o Time to acquire a lock

More information

Chapter 6: Process Synchronization. Operating System Concepts 9 th Edit9on

Chapter 6: Process Synchronization. Operating System Concepts 9 th Edit9on Chapter 6: Process Synchronization Operating System Concepts 9 th Edit9on Silberschatz, Galvin and Gagne 2013 Objectives To present the concept of process synchronization. To introduce the critical-section

More information

Resource Access Control (2) Real-Time and Embedded Systems (M) Lecture 14

Resource Access Control (2) Real-Time and Embedded Systems (M) Lecture 14 Resource Access Control (2) Real-Time and Embedded Systems (M) Lecture 14 Lecture Outline Resources access control (cont d): Enhancing the priority ceiling protocol Stack-based priority ceiling protocol

More information

A Server-based Approach for Predictable GPU Access Control

A Server-based Approach for Predictable GPU Access Control A Server-based Approach for Predictable GPU Access Control Hyoseung Kim 1, Pratyush Patel 2, Shige Wang 3, and Ragunathan (Raj) Rajkumar 2 1 University of California, Riverside 2 Carnegie Mellon University

More information

Locks. Dongkun Shin, SKKU

Locks. Dongkun Shin, SKKU Locks 1 Locks: The Basic Idea To implement a critical section A lock variable must be declared A lock variable holds the state of the lock Available (unlocked, free) Acquired (locked, held) Exactly one

More information

Chapter 6 Process Synchronization

Chapter 6 Process Synchronization Chapter 6 Process Synchronization Cooperating Process process that can affect or be affected by other processes directly share a logical address space (threads) be allowed to share data via files or messages

More information

Multiprocessor Systems. Chapter 8, 8.1

Multiprocessor Systems. Chapter 8, 8.1 Multiprocessor Systems Chapter 8, 8.1 1 Learning Outcomes An understanding of the structure and limits of multiprocessor hardware. An appreciation of approaches to operating system support for multiprocessor

More information

CMPS 111 Spring 2013 Prof. Scott A. Brandt Midterm Examination May 6, Name: ID:

CMPS 111 Spring 2013 Prof. Scott A. Brandt Midterm Examination May 6, Name: ID: CMPS 111 Spring 2013 Prof. Scott A. Brandt Midterm Examination May 6, 2013 Name: ID: This is a closed note, closed book exam. There are 23 multiple choice questions, 6 short answer questions. Plan your

More information

Lecture 9: Multiprocessor OSs & Synchronization. CSC 469H1F Fall 2006 Angela Demke Brown

Lecture 9: Multiprocessor OSs & Synchronization. CSC 469H1F Fall 2006 Angela Demke Brown Lecture 9: Multiprocessor OSs & Synchronization CSC 469H1F Fall 2006 Angela Demke Brown The Problem Coordinated management of shared resources Resources may be accessed by multiple threads Need to control

More information

AUTOSAR Extensions for Predictable Task Synchronization in Multi- Core ECUs

AUTOSAR Extensions for Predictable Task Synchronization in Multi- Core ECUs 11AE-0089 AUTOSAR Extensions for Predictable Task Synchronization in Multi- Core ECUs Copyright 2011 SAE International Karthik Lakshmanan, Gaurav Bhatia, Ragunathan (Raj) Rajkumar Carnegie Mellon University

More information

Real-Time Performance of Linux. OS Latency

Real-Time Performance of Linux. OS Latency Real-Time Performance of Linux Among others: A Measurement-Based Analysis of the Real- Time Performance of Linux (L. Abeni, A. Goel, C. Krasic, J. Snow, J. Walpole) [RTAS 2002] OS Latency Definition [OS

More information

An Improved Priority Ceiling Protocol to Reduce Context Switches in Task Synchronization 1

An Improved Priority Ceiling Protocol to Reduce Context Switches in Task Synchronization 1 An Improved Priority Ceiling Protocol to Reduce Context Switches in Task Synchronization 1 Albert M.K. Cheng and Fan Jiang Computer Science Department University of Houston Houston, TX, 77204, USA http://www.cs.uh.edu

More information

Reservation-Based Scheduling for IRQ Threads

Reservation-Based Scheduling for IRQ Threads Reservation-Based Scheduling for IRQ Threads Luca Abeni, Nicola Manica, Luigi Palopoli luca.abeni@unitn.it, nicola.manica@gmail.com, palopoli@dit.unitn.it University of Trento, Trento - Italy Reservation-Based

More information

Predictive Thread-to-Core Assignment on a Heterogeneous Multi-core Processor*

Predictive Thread-to-Core Assignment on a Heterogeneous Multi-core Processor* Predictive Thread-to-Core Assignment on a Heterogeneous Multi-core Processor* Tyler Viswanath Krishnamurthy, and Hridesh Laboratory for Software Design Department of Computer Science Iowa State University

More information

Real-Time Synchronization on Multiprocessors: To Block or Not to Block, to Suspend or Spin?

Real-Time Synchronization on Multiprocessors: To Block or Not to Block, to Suspend or Spin? Real-Time Synchronization on Multiprocessors: To lock or Not to lock, to Suspend or Spin? jörn. randenburg, John Calandrino, Aaron lock, Hennadiy Leontyev, and James H. Anderson Department of Computer

More information

«Real Time Embedded systems» Multi Masters Systems

«Real Time Embedded systems» Multi Masters Systems «Real Time Embedded systems» Multi Masters Systems rene.beuchat@epfl.ch LAP/ISIM/IC/EPFL Chargé de cours rene.beuchat@hesge.ch LSN/hepia Prof. HES 1 Multi Master on Chip On a System On Chip, Master can

More information

Document downloaded from: http://hdl.handle.net/10251/38978 This paper must be cited as: Sáez Barona, S.; Crespo, A. (2013). Deferred setting of scheduling attributes in Ada 2012. Ada Letters. 33(1):93-100.

More information

Kernel Critical Sections

Kernel Critical Sections Kernel Critical Sections Real Time Operating Systems and Middleware Luca Abeni luca.abeni@unitn.it Critical Sections in Kernel Code Old Linux kernels used to be non-preemptable... Kernel Big critical section

More information

Adaptive Lock. Madhav Iyengar < >, Nathaniel Jeffries < >

Adaptive Lock. Madhav Iyengar < >, Nathaniel Jeffries < > Adaptive Lock Madhav Iyengar < miyengar@andrew.cmu.edu >, Nathaniel Jeffries < njeffrie@andrew.cmu.edu > ABSTRACT Busy wait synchronization, the spinlock, is the primitive at the core of all other synchronization

More information

Real-Time (Paradigms) (47)

Real-Time (Paradigms) (47) Real-Time (Paradigms) (47) Memory: Memory Access Protocols Tasks competing for exclusive memory access (critical sections, semaphores) become interdependent, a common phenomenon especially in distributed

More information

Multicore for safety-critical embedded systems: challenges andmarch opportunities 15, / 28

Multicore for safety-critical embedded systems: challenges andmarch opportunities 15, / 28 Multicore for safety-critical embedded systems: challenges and opportunities Giuseppe Lipari CRItAL - Émeraude March 15, 2016 Multicore for safety-critical embedded systems: challenges andmarch opportunities

More information

C++ Threading. Tim Bailey

C++ Threading. Tim Bailey C++ Threading Introduction Very basic introduction to threads I do not discuss a thread API Easy to learn Use, eg., Boost.threads Standard thread API will be available soon The thread API is too low-level

More information

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy Operating Systems Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com Email : eaymanelshenawy@yahoo.com Reference

More information

Chapter 6 Concurrency: Deadlock and Starvation

Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles Chapter 6 Concurrency: Deadlock and Starvation Seventh Edition By William Stallings Operating Systems: Internals and Design Principles When two trains

More information

Lesson 6: Process Synchronization

Lesson 6: Process Synchronization Lesson 6: Process Synchronization Chapter 5: Process Synchronization Background The Critical-Section Problem Peterson s Solution Synchronization Hardware Mutex Locks Semaphores Classic Problems of Synchronization

More information

Resource Access Protocols

Resource Access Protocols The Blocking Problem Resource Access Protocols Now we remove the assumption that tasks are independent, sharing resources, t interacting The main problem: priority inversion igh priority tasks are blocked

More information