Hardware Latencies How to flush them out (A use case) Steven Rostedt Red Hat

Size: px
Start display at page:

Download "Hardware Latencies How to flush them out (A use case) Steven Rostedt Red Hat"

Transcription

1 Hardware Latencies How to flush them out (A use case) Steven Rostedt Red Hat

2 Here s a story, of a lovely lady... No this isn t the Brady Bunch Nor is it about a lovely lady But it probably could have been a Brady Bunch episode.

3 Here s a story, of an upset customer Who were seeing lots of latencies on their own The machine wasn t verified yet Real time requires not just a kernel Requires the entire spectrum Application Kernel Hard ware

4 Here s a story, of an upset customer Who were seeing lots of latencies on their own The machine wasn t verified yet Real time requires not just a kernel Requires the entire spectrum Application Kernel Hard ware

5 Verification of Hardware rteval A tool by Red Hat to stress the machine Measures jitter (using cyclictest) Was a large machine 40 CPUs For such a box, we expect no more than 200us jitter Like less, but we are lenient with large HW

6 Latencies Seeing 500us latencies!!!! May not sound big to you But it's huge for PREEMPT_RT Took a while to hit that Was it HW? SW? We control the app (rteval) Of course I blamed the HW ;-) Of course the HW vendor blamed SW

7 The Enemy 500 microsecond latency Function tracing Latency tracers HW Lat detector Event tracing trace_printk() The Weapons

8 Function Tracing echo function > current_tracer echo function_graph > current_tracer trace-cmd is nicer trace-cmd start -p function_graph trace-cmd stop trace-cmd extract trace-cmd report

9 rteval hackbench kernel builds cyclictest rteval --duration=100h

10 rteval Breaking it up rteval --onlyload --duration=100h Does not run cyclictest Run cyclictest separately

11 cyclictest cyclictest --numa -p95 -d0 -i100 -qm numa implies -a -t -n a - bind a task to each CPU t - thread per CPU n - use nanosleep() not signals p95 - set priority to 95 d0 - all threads run same interval i100 - sleep for 100 us q - quiet - don't show status during test m - mlockall memory

12 cyclictest cyclictest --numa -p95 -d0 -i100 -qm -b 200 b break after 200 us latency implies running function tracer Stops tracer on latency too Function tracing adds a lot of overhead! cyclictest --numa -p95 -d0 -i100 -qm -b 1000 increase breakpoint by a lot!

13 cyclictest Function tracing adds too much overhead cyclictest --numa -p95 -d0 -i100 -qm -b 200 -E E - uses event tracing instead of function Better with latencies Not as much info

14 cyclictest Limit function tracing with trace-cmd trace-cmd start -p function -n '*lock* trace-cmd start -p function -l '*sched*'' cyclictest --numa -p95 -d0 -i100 -qm -b 300

15 Latency Tracers wakeup-rt Ignore wakeup tracer preemptirqsoff Just ignore the: irqsoff preemptoff

16 Wakeup-rt trace-cmd start -p wakeup-rt Records the time of the highest -rt task Problems From wake up to schedule defaults running function tracer trace-cmd start -p wakeup-rt -d disables function tracing Not much info without functions trace-cmd start -p wakeup-rt -d -e all enables all events

17 Wakeup-rt Didn't help :-( Not enough info with events Function tracing caused latencies Hard to determine if latency was real or Heisenbug

18 preemptirqsoff trace-cmd start -p preemptirqsoff -e all -d Showed us issues with the scheduler Pointed to load balancing but that was a symptom not the cause

19 Modified cyclictest Changed to use function graph instead of function trace-cmd -p function -l load_balance <idle>-0 [000] : function: load_balance <idle>-0 [001] : function: load_balance <idle>-0 [000] : function: load_balance

20 Modified cyclictest trace-cmd -p function_graph -l load_balance Much more useful <idle>-0 [002] : us load_balance(); <idle>-0 [003] : us load_balance(); <idle>-0 [002] : us load_balance(); <idle>-0 [003] : us load_balance();

21 Latency without Load Balance? Hit a latency, and load balance wasn't called? PREEMPT_RT converts spinlocks to mutex except for raw_spin_locks! trace-cmd start -p function_graph \ -l '*raw_spin_lock*' <idle>-0 24dN : funcgraph_entry:! us _raw_spin_lock_irqsave();

22 Latency without Load Balance? Hit a latency, and load balance wasn't called? PREEMPT_RT converts spinlocks to mutex except for raw_spin_locks! trace-cmd start -p function_graph \ -l '*raw_spin_lock*' entry:! us _ra

23 Latency without Load Balance? Hit a latency, and load balance wasn't called? PREEMPT_RT converts spinlocks to mutex except for raw_spin_locks! trace-cmd start -p function_graph \ -l '*raw_spin_lock*' entry:! us _ra

24 Graph vs Function Tracing graph gives you time of function held function tracing can give you backtrace trace-cmd -p function -l 'raw_spin*' --func-stack trace-cmd-8725 [002] : function: trace-cmd-8725 [002] : kernel_stack: => schedule (ffffffff8146d08f) => schedule (ffffffff8146dd09) => do_nanosleep (ffffffff8146c7ec) => hrtimer_nanosleep (ffffffff8106eecb) => sys_nanosleep (ffffffff8106f00e) => system_call_fastpath (ffffffff ) _raw_spin_lock_irq <stack trace>

25 What to do? Keep function graph Add events All events added their own latencies Limit the events to trace trace-cmd start -p function_graph -l '*raw_spin_lock*' -e sched -e timer -e irq

26 Long story short Found latency rq lock contention in pull_rt_tasks 30 or more CPUs tried to take the same lock Between cache line bouncing and locking the bus, caused a large HW latency but you can still blame SW Fixed by doing IPIs instead

27 Pull RT Tasks CPU 0 CPU 1 CPU 2 CPU 40 cyclic test prio 90 cyclic test prio 90 cyclic test prio 90 cyclic test prio 90

28 Pull RT Tasks CPU 0 CPU 1 CPU 2 CPU 40 cyclic test prio 90 cyclic test prio 90 watchdog prio 99 cyclic test prio 90 cyclic test prio 90

29 Pull RT Tasks CPU 0 CPU 1 CPU 2 CPU 40 cyclic test prio 90 cyclic test prio 90 cyclic test prio 90 cyclic test prio 90

30 Pull RT Tasks CPU 0 CPU 1 CPU 2 CPU 40 cyclic test prio 90 cyclic test prio 90 cyclic test prio 90 cyclic test prio 90 irq thread prio 50

31 Pull RT Tasks CPU 0 CPU 1 CPU 2 CPU 40 <idle> <idle> cyclic test prio 90 <idle> irq thread prio 50

32 The Finding Nemo Seagull Effect! Mine

33 Pull RT Tasks The Finding Nemo Seagull Effect CPU 0 CPU 1 CPU 2 CPU 40 <idle> <idle> cyclic test prio 90 <idle> irq thread prio 50

34 Pull RT Tasks The Finding Nemo Seagull Effect CPU 0 CPU 1 CPU 2 CPU 40 <idle> <idle> cyclic test prio 90 <idle> Mine Mine irq thread prio 50 Mine

35 Pull RT Tasks IPI to push task CPU 0 CPU 1 CPU 2 CPU 40 <idle> <idle> cyclic test prio 90 <idle> irq thread prio 50

36 Pull RT Tasks IPI to push task CPU 0 CPU 1 CPU 2 CPU 40 <idle> <idle> cyclic test prio 90 <idle> IPI IPI irq thread prio 50 IPI

37 Pull RT Tasks IPI to push task CPU 0 CPU 1 CPU 2 CPU 40 <idle> irq thread prio 50 cyclic test prio 90 <idle>

38 The End? Looked like we found our bug! Started verification process Told everyone things will be verified shortly

39 Nope! Passed a 12 hour run Failed a 24 hour run Lets start again!

40 HW Lat Detector Hard ware latency detector Runs periodic stop machine Define a period and run run!= period system will lock up Spins looking for latency

41 HW Lat Issue While (now - start < perido) { tmp = timestamp(); now = timestamp(); diff = now - tmp; if (diff > thresh) record(); }

42 HW Lat Issue 80% While (now - start < perido) { tmp = timestamp(); now = timestamp(); diff = now - tmp; if (diff > thresh) record(); } 20%

43 HW Lat Issue Last = 0; While (now - start < perido) { tmp = timestamp(); now = timestamp(); if (last) { diff = tmp - last; if (diff > outer_thresh) record_outer(); } last = now; diff = now - tmp; if (diff > thresh) record(); }

44 HW Lat Detector Stop Machine Needs to run periodically Will lock up the system otherwise Has chance to miss latency again! Changed to a thread Thread takes up one of the CPUs Still needs to yield Locks up machine otherwise But yield is much smaller than periodic More likely to measure latency

45 But not good enough HW Lat Detector Worked! Vendor did not trust this code??? Had to use their code Did somewhat the same thing In userspace Could easily miss latencies

46 trace-cmd trace-cmd start -p function_graph -l raw_spin* -e all Modified cyclictest to use function graph Still limited to raw_spin* locks Wont disable the events started cyclictest will still stop the trace on latency

47 trace-cmd ksoftirqd/ [033] : timer_cancel: timer=0xffff88403f0ce520 ksoftirqd/ [033] : timer_expire_entry: timer=0xffff88403f0ce520 function=delayed_work ksoftirqd/ [033] : funcgraph_entry: us _raw_spin_lock_irqsave(); ksoftirqd/ [033] : funcgraph_entry: us _raw_spin_lock(); ksoftirqd/ [033] : sched_stat_sleep: comm=kworker/33:1 pid=1222 delay= ksoftirqd/ [033] : sched_wakeup: kworker/33:1:1222 [120] success=1 CPU:033 ksoftirqd/ [033] : timer_expire_exit: timer=0xffff88403f0ce520 ksoftirqd/ [033] : timer_cancel: timer=0xffff88403f0ce620 ksoftirqd/ [033] : timer_expire_entry: timer=0xffff88403f0ce620 function=delayed_work ksoftirqd/ [033] : funcgraph_entry: us _raw_spin_lock_irqsave(); ksoftirqd/ [033] : timer_expire_exit: timer=0xffff88403f0ce620 cyclictest-6110 [007] : funcgraph_entry: us _raw_spin_lock(); cyclictest-6110 [007] : funcgraph_entry: us _raw_spin_lock_irqsave(); cyclictest-6110 [007] : funcgraph_entry: us _raw_spin_lock_irqsave(); cyclictest-6113 [010] : funcgraph_entry: us _raw_spin_lock(); cyclictest-6110 [007] : funcgraph_entry: us _raw_spin_lock(); cyclictest-6110 [007] : sched_wakeup: cyclictest:6113 [4] success=1 CPU:010 cyclictest-6110 [007] : funcgraph_entry: us _raw_spin_lock_irqsave(); cyclictest-6113 [010] : funcgraph_entry: us _raw_spin_lock_irq(); cyclictest-6113 [010] : funcgraph_entry: us _raw_spin_lock_irqsave(); cyclictest-6113 [010] : funcgraph_entry: us _raw_spin_lock_irq(); cyclictest-6110 [007] : print: ffffffff810e5776 hit latency threshold (247 > 200)

48 trace-cmd trace-cmd report Lots of information Detailed information Great to analyze TOO MUCH INFO! Can not understand it all Hard to see the big picture KernelShark

49 kernelshark

50 kernelshark

51 kernelshark

52 kernelshark

53 kernelshark

54 kernelshark

55 kernelshark

56 kernelshark

57 Demo

58 Questions?

59 Questions? Yeah Right? Like we have time.

Using and Understanding the Real-Time Cyclictest Benchmark

Using and Understanding the Real-Time Cyclictest Benchmark Using and Understanding the Real-Time Cyclictest Benchmark Cyclictest results are the most frequently cited real-time Linux metric. The core concept of Cyclictest is very simple. However the test options

More information

e-ale-rt-apps Building Real-Time Applications for Linux Version c CC-BY SA4

e-ale-rt-apps Building Real-Time Applications for Linux Version c CC-BY SA4 e-ale-rt-apps Building Real-Time Applications for Linux Version 20181023 ii The E-ALE (Embedded Apprentice Linux Engineer) is a series of seminars held at existing conferences covering topics which are

More information

Debugging realtime application with Ftrace

Debugging realtime application with Ftrace Debugging realtime application with Ftrace Pierre Ficheux (pierre.ficheux@smile.fr) 02/2018 1 Disclaimer Poor English speaker! But good French speaker and writer :-) Loin du français je meurs (Louis-Ferdinand

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

Adventures In Real-Time Performance Tuning, Part 2

Adventures In Real-Time Performance Tuning, Part 2 Adventures In Real-Time Performance Tuning, Part 2 The real-time for Linux patchset does not guarantee adequate real-time behavior for all target platforms. When using real-time Linux on a new platform

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

Ftrace Kernel Hooks: More than just tracing. Presenter: Steven Rostedt Red Hat

Ftrace Kernel Hooks: More than just tracing. Presenter: Steven Rostedt Red Hat Ftrace Kernel Hooks: More than just tracing Presenter: Steven Rostedt rostedt@goodmis.org Red Hat Ftrace Function Hooks Function Tracer Function Graph Tracer Function Profiler Stack Tracer Kprobes Uprobes

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

Debugging Real-Time issues in Linux

Debugging Real-Time issues in Linux Debugging Real-Time issues in Linux Embedded Linux Conference, Europe Joel Fernandes joel@linuxinternals.org Real time - terminology For purposes of this task Period Time Interval between which RT task

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

How to get realistic C-states latency and residency? Vincent Guittot

How to get realistic C-states latency and residency? Vincent Guittot How to get realistic C-states latency and residency? Vincent Guittot Agenda Overview Exit latency Enter latency Residency Conclusion Overview Overview PMWG uses hikey960 for testing our dev on b/l system

More information

Rt-tests Status report

Rt-tests Status report Rt-tests Status report Quick overview of the tests in the suite Discussion of recent changes and new features Ideas for the future Discussion / Open the floor to a wishlist for the future. rt-tests Suite

More information

When the OS gets in the way

When the OS gets in the way When the OS gets in the way (and what you can do about it) Mark Price @epickrram LMAX Exchange Linux When the OS gets in the way (and what you can do about it) Mark Price @epickrram LMAX Exchange It s

More information

Understanding Real Time Linux. Alex Shi

Understanding Real Time Linux. Alex Shi Understanding Real Time Linux Alex Shi Agenda What s real time OS RTL project status RT testing and tracing Reasons of latency and solutions for them Resources Summary What s real time OS Real time and

More information

Evaluation of uclinux and PREEMPT_RT for Machine Control System

Evaluation of uclinux and PREEMPT_RT for Machine Control System Evaluation of uclinux and PREEMPT_RT for Machine Control System 2014/05/20 Hitachi, Ltd. Yokohama Research Lab Linux Technology Center Yoshihiro Hayashi yoshihiro.hayashi.cd@hitachi.com Agenda 1. Background

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

The Ephemeral Smoking Gun

The Ephemeral Smoking Gun The Ephemeral Smoking Gun Using ftrace and kgdb to resolve a pthread deadlock LabVIEW Real-Time National Instruments The Setup Customer application crashed after a few hours The clincher: new issue from

More information

Ftrace Profiling. Presenter: Steven Rostedt Red Hat

Ftrace Profiling. Presenter: Steven Rostedt Red Hat Ftrace Profiling Presenter: Steven Rostedt rostedt@goodmis.org Red Hat What do you want to profile? Application Cache misses Memory locality Page faults Finding bad algorithms O(n^2) CPU cycles I/O usage

More information

Latency on preemptible Real-Time Linux

Latency on preemptible Real-Time Linux Appendix 1 Latency on preemptible Real-Time Linux on DCP-SH7780 Contents 1.1 Getting Started.......................................... 1 1.2 Rtrtc Driver........................................... 2 1.3

More information

Adding Inter-event Capabilities to the Linux Trace Event Subsystem

Adding Inter-event Capabilities to the Linux Trace Event Subsystem Adding Inter-event Capabilities to the Linux Trace Event Subsystem Tom Zanussi Intel Open Source Technology Center Safety Critical Systems ELC 2017, Feb 22 1 Trace Events Background Latency Example Design

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

Case Study: Challenges and Benefits in Integrating Real Time patch in PowerPc Based Media System

Case Study: Challenges and Benefits in Integrating Real Time patch in PowerPc Based Media System Case Study: Challenges and Benefits in Integrating Real Time patch in PowerPc Based Media System Manikandan Ramachandran Infosys Technologies Limited Electronic City, Hosur Road, Bengaluru 560100,India

More information

Ftrace - What s new. Since my last explanation of ftrace (from v3.18) Steven Rostedt 25/10/ VMware Inc. All rights reserved.

Ftrace - What s new. Since my last explanation of ftrace (from v3.18) Steven Rostedt 25/10/ VMware Inc. All rights reserved. Ftrace - What s new Since my last explanation of ftrace (from v3.18) Steven Rostedt 25/10/2017 2017 VMware Inc. All rights reserved. What ftrace did (and still does) Function tracing Function graph tracing

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

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

Path analysis vs. empirical determination of a system's real-time capabilities: The crucial role of latency tests

Path analysis vs. empirical determination of a system's real-time capabilities: The crucial role of latency tests Path analysis vs. empirical determination of a system's real-time capabilities: The crucial role of latency tests Carsten Emde Open Source Automation Development Lab (OSADL) eg Issues leading to system

More information

Abstract. Testing Parameters. Introduction. Hardware Platform. Native System

Abstract. Testing Parameters. Introduction. Hardware Platform. Native System Abstract In this paper, we address the latency issue in RT- XEN virtual machines that are available in Xen 4.5. Despite the advantages of applying virtualization to systems, the default credit scheduler

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

Testing real-time Linux: What to test and how.

Testing real-time Linux: What to test and how. Testing real-time Linux: What to test and how. Sripathi Kodi sripathik@in.ibm.com Agenda IBM Linux Technology Center What is a real-time Operating System? Enterprise real-time Real-Time patches for Linux

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

System Wide Tracing User Need

System Wide Tracing User Need System Wide Tracing User Need dominique toupin ericsson com April 2010 About me Developer Tool Manager at Ericsson, helping Ericsson sites to develop better software efficiently Background

More information

Interrupts and Time. Real-Time Systems, Lecture 5. Martina Maggio 28 January Lund University, Department of Automatic Control

Interrupts and Time. Real-Time Systems, Lecture 5. Martina Maggio 28 January Lund University, Department of Automatic Control Interrupts and Time Real-Time Systems, Lecture 5 Martina Maggio 28 January 2016 Lund University, Department of Automatic Control Content [Real-Time Control System: Chapter 5] 1. Interrupts 2. Clock Interrupts

More information

RAS Enhancement Activities for Mission-Critical Linux Systems

RAS Enhancement Activities for Mission-Critical Linux Systems RAS Enhancement Activities for MissionCritical Linux Systems Hitachi Ltd. Yoshihiro YUNOMAE 01 MissionCritical Systems We apply Linux to missioncritical systems. Banking systems/carrier backend systems/train

More information

Interrupts and Time. Interrupts. Content. Real-Time Systems, Lecture 5. External Communication. Interrupts. Interrupts

Interrupts and Time. Interrupts. Content. Real-Time Systems, Lecture 5. External Communication. Interrupts. Interrupts Content Interrupts and Time Real-Time Systems, Lecture 5 [Real-Time Control System: Chapter 5] 1. Interrupts 2. Clock Interrupts Martina Maggio 25 January 2017 Lund University, Department of Automatic

More information

The PREEMPT_RT Approach To Real Time

The PREEMPT_RT Approach To Real Time The PREEMPT_RT Approach To Real Time Wu Zhangjin / Falcon wuzhangjin@gmail.com 泰晓科技 TinyLab.org http://tinylab.org March 21, 2014 The PREEMPT_RT Approach To Real Time March 21, 2014 1 / 51 Overview 1 Introduction

More information

Pro Audio is Easy, Consumer Audio is Hard

Pro Audio is Easy, Consumer Audio is Hard Linux Audio Confernce 2010 lennart@poettering.net May 2010 Who Am I? Software Engineer at Red Hat, Inc. Developer of PulseAudio, Avahi and a few other Free Software projects http://0pointer.de/lennart/

More information

Maintaining a Real Time Stable Kernel What s different than a vanilla stable kernel?

Maintaining a Real Time Stable Kernel What s different than a vanilla stable kernel? Maintaining a Real Time Stable Kernel What s different than a vanilla stable kernel? Steven Rostedt 3/13/2018 2016 2018 VMware Inc. All rights reserved. Upstream Stable Releases After all mainline releases

More information

6.033 Computer System Engineering

6.033 Computer System Engineering MIT OpenCourseWare http://ocw.mit.edu 6.033 Computer System Engineering Spring 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. 6.003 Lecture 7: Threads

More information

Realtime Tuning 101. Tuning Applications on Red Hat MRG Realtime Clark Williams

Realtime Tuning 101. Tuning Applications on Red Hat MRG Realtime Clark Williams Realtime Tuning 101 Tuning Applications on Red Hat MRG Realtime Clark Williams Agenda Day One Terminology and Concepts Realtime Linux differences from stock Linux Tuning Tools for Tuning Tuning Tools Lab

More information

CS 326: Operating Systems. CPU Scheduling. Lecture 6

CS 326: Operating Systems. CPU Scheduling. Lecture 6 CS 326: Operating Systems CPU Scheduling Lecture 6 Today s Schedule Agenda? Context Switches and Interrupts Basic Scheduling Algorithms Scheduling with I/O Symmetric multiprocessing 2/7/18 CS 326: Operating

More information

Application Testing under Realtime Linux. Luis Claudio R. Gonçalves Red Hat Realtime Team Software Engineer

Application Testing under Realtime Linux. Luis Claudio R. Gonçalves Red Hat Realtime Team Software Engineer Application Testing under Realtime Linux Luis Claudio R. Gonçalves Red Hat Realtime Team Software Engineer Agenda * Realtime Basics * Linux and the PREEMPT_RT patch * About the Tests * Looking for bad

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

Preempt-RT Raspberry Linux. VMware Tiejun Chen

Preempt-RT Raspberry Linux. VMware Tiejun Chen Preempt-RT Raspberry Linux VMware Tiejun Chen The declaration of this development This is my personal exploration. This is not a roadmap or commitment from VMware. Agenda Motivation

More information

Measuring and Summarizing Latencies Using Trace Events. Tom Zanussi, Intel Open Source Technology Center, ELC 2018

Measuring and Summarizing Latencies Using Trace Events. Tom Zanussi, Intel Open Source Technology Center, ELC 2018 Measuring and Summarizing Latencies Using Trace Events Tom Zanussi, Intel Open Source Technology Center, ELC 2018 Trace Events Background Latency Calculations and Handlers and Actions Latency Histograms

More information

Real-Time Task Partitioning using Cgroups

Real-Time Task Partitioning using Cgroups Real-Time Task Partitioning using Cgroups Akihiro SUZUKI Advanced Software Technology Group Corporate Software Engineering Center TOSHIBA CORPORATION 2013/06/07 Copyright 2013, Toshiba Corporation. Self-Introduction

More information

Development of Real-Time Systems with Embedded Linux. Brandon Shibley Senior Solutions Architect Toradex Inc.

Development of Real-Time Systems with Embedded Linux. Brandon Shibley Senior Solutions Architect Toradex Inc. Development of Real-Time Systems with Embedded Linux Brandon Shibley Senior Solutions Architect Toradex Inc. Overview Toradex ARM-based System-on-Modules Pin-Compatible SoM Families In-house HW and SW

More information

System and Application Analysis with LTTng

System and Application Analysis with LTTng Corporate Technology System and Application Analysis with LTTng Project examples Serial input latency Sporadic delay in high prio application thread How LTTng was used in Siemens projects to solve problems

More information

Ineffective and effective way to find out latency bottlenecks by Ftrace

Ineffective and effective way to find out latency bottlenecks by Ftrace Ineffective and effective way to find out latency bottlenecks by Ftrace Yoshitake Kobayashi Advanced Software Technology Group Corporate Software Engineering Center TOSHIBA CORPORATION 16 Feb, 212 Copyright

More information

ò Paper reading assigned for next Tuesday ò Understand low-level building blocks of a scheduler User Kernel ò Understand competing policy goals

ò Paper reading assigned for next Tuesday ò Understand low-level building blocks of a scheduler User Kernel ò Understand competing policy goals Housekeeping Paper reading assigned for next Tuesday Scheduling Don Porter CSE 506 Memory Management Logical Diagram Binary Memory Formats Allocators Threads Today s Lecture Switching System to CPU Calls

More information

The Status of the Preempt-RT Patch

The Status of the Preempt-RT Patch The Status of the Preempt-RT Patch Embedded Linux Conference Europe 217 Sebastian A. Siewior Linutronix GmbH October 24, 217 Sebastian A. Siewior Linutronix GmbH 1/35 1 Overview 2 The patchqueue 3 Summary

More information

Review of the Stable Realtime Release Process

Review of the Stable Realtime Release Process Review of the Stable Realtime Release Process An unscientific, slightly opinionated stab at the current status... With the intent of generating some discussion. Frank Rowand, Sony Network Entertainment

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

The Deadlock Lecture

The Deadlock Lecture Concurrent systems Lecture 4: Deadlock, Livelock, and Priority Inversion DrRobert N. M. Watson The Deadlock Lecture 1 Reminder from last time Multi-Reader Single-Writer (MRSW) locks Alternatives to semaphores/locks:

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

CSCE Operating Systems Interrupts, Exceptions, and Signals. Qiang Zeng, Ph.D. Fall 2018

CSCE Operating Systems Interrupts, Exceptions, and Signals. Qiang Zeng, Ph.D. Fall 2018 CSCE 311 - Operating Systems Interrupts, Exceptions, and Signals Qiang Zeng, Ph.D. Fall 2018 Previous Class Process state transition Ready, blocked, running Call Stack Execution Context Process switch

More information

The Kernel Report. (Plumbers 2010 edition) Jonathan Corbet LWN.net

The Kernel Report. (Plumbers 2010 edition) Jonathan Corbet LWN.net The Kernel Report (Plumbers 2010 edition) Jonathan Corbet LWN.net corbet@lwn.net Yeah, yeah, maybe you're waiting for flower power and free sex. Good for you. But if you are, don't ask the Linux kernel

More information

Enhancing Linux Scheduler Scalability

Enhancing Linux Scheduler Scalability Enhancing Linux Scheduler Scalability Mike Kravetz IBM Linux Technology Center Hubertus Franke, Shailabh Nagar, Rajan Ravindran IBM Thomas J. Watson Research Center {mkravetz,frankeh,nagar,rajancr}@us.ibm.com

More information

Porting RT-preempt to Loongson2F

Porting RT-preempt to Loongson2F Porting RT-preempt to Loongson2F Wu Zhangjin, Nicholas Mc Guire Distributed & Embedded System Lab, SISE, Lanzhou University, China Tianshui South Road 222,Lanzhou,P.R.China wuzhangjin@gmail.com, der.herr@hofr.at

More information

OS lpr. www. nfsd gcc emacs ls 1/27/09. Process Management. CS 537 Lecture 3: Processes. Example OS in operation. Why Processes? Simplicity + Speed

OS lpr. www. nfsd gcc emacs ls 1/27/09. Process Management. CS 537 Lecture 3: Processes. Example OS in operation. Why Processes? Simplicity + Speed Process Management CS 537 Lecture 3: Processes Michael Swift This lecture begins a series of topics on processes, threads, and synchronization Today: processes and process management what are the OS units

More information

Kernel Korner What's New in the 2.6 Scheduler

Kernel Korner What's New in the 2.6 Scheduler Kernel Korner What's New in the 2.6 Scheduler When large SMP systems started spending more time scheduling processes than running them, it was time for a change. by Rick Lindsley As work began on the 2.5

More information

Barrelfish Project ETH Zurich. Message Notifications

Barrelfish Project ETH Zurich. Message Notifications Barrelfish Project ETH Zurich Message Notifications Barrelfish Technical Note 9 Barrelfish project 16.06.2010 Systems Group Department of Computer Science ETH Zurich CAB F.79, Universitätstrasse 6, Zurich

More information

[537] Locks. Tyler Harter

[537] Locks. Tyler Harter [537] Locks Tyler Harter Review: Threads+Locks CPU 1 CPU 2 running thread 1 running thread 2 RAM PageDir A PageDir B CPU 1 CPU 2 running thread 1 running thread 2 RAM PageDir A PageDir B Virt Mem (PageDir

More information

OS Structure. User mode/ kernel mode (Dual-Mode) Memory protection, privileged instructions. Definition, examples, how it works?

OS Structure. User mode/ kernel mode (Dual-Mode) Memory protection, privileged instructions. Definition, examples, how it works? Midterm Review OS Structure User mode/ kernel mode (Dual-Mode) Memory protection, privileged instructions System call Definition, examples, how it works? Other concepts to know Monolithic kernel vs. Micro

More information

Decoding Those Inscrutable RCU CPU Stall Warnings

Decoding Those Inscrutable RCU CPU Stall Warnings Paul E. McKenney, IBM Distinguished Engineer, Linux Technology Center Member, IBM Academy of Technology Open Source Summit North America, September 12, 2017 Decoding Those Inscrutable RCU CPU Stall Warnings

More information

2013 Toshiba Corporation

2013 Toshiba Corporation 2013 Toshiba Corporation Who am I? Yoshitake Kobayashi (YOSHI) Chief Specialist at Corporate Software Engineering Center, TOSHIBA CORPORATION Work on embedded operating systems Linux RTOS TOPPERS (uitron),

More information

Inferring Temporal Behaviours Through Kernel Tracing

Inferring Temporal Behaviours Through Kernel Tracing Inferring Temporal Behaviours Through Kernel Tracing Paolo Rallo, Nicola Manica, Luca Abeni University of Trento Trento - Italy prallo@gmail.com, nicola.manica@disi.unitn.it, luca.abeni@unitn.it Technical

More information

Creating User-Friendly Exploits

Creating User-Friendly Exploits 1 Creating User-Friendly Exploits Skylar Rampersaud skylar@immunityinc.com Security Research 2 What is a User-Friendly Exploit? An exploit that causes no distress to the user of the exploited program i.e.,

More information

Notes based on prof. Morris's lecture on scheduling (6.824, fall'02).

Notes based on prof. Morris's lecture on scheduling (6.824, fall'02). Scheduling Required reading: Eliminating receive livelock Notes based on prof. Morris's lecture on scheduling (6.824, fall'02). Overview What is scheduling? The OS policies and mechanisms to allocates

More information

Problem Set 2. CS347: Operating Systems

Problem Set 2. CS347: Operating Systems CS347: Operating Systems Problem Set 2 1. Consider a clinic with one doctor and a very large waiting room (of infinite capacity). Any patient entering the clinic will wait in the waiting room until the

More information

SFO The Linux Kernel Scheduler. Viresh Kumar (PMWG)

SFO The Linux Kernel Scheduler. Viresh Kumar (PMWG) SFO17-421 The Linux Kernel Scheduler Viresh Kumar (PMWG) Topics CPU Scheduler The O(1) scheduler Current scheduler design Scheduling classes schedule() Scheduling classes and policies Sched class: STOP

More information

Tweaking Linux for a Green Datacenter

Tweaking Linux for a Green Datacenter Tweaking Linux for a Green Datacenter Vaidyanathan Srinivasan Jenifer Hopper Agenda Platform features and Linux exploitation Tuning scheduler and cpufreq

More information

Load Balancing. Minsoo Ryu. Department of Computer Science and Engineering. Hanyang University. Real-Time Computing and Communications Lab.

Load Balancing. Minsoo Ryu. Department of Computer Science and Engineering. Hanyang University. Real-Time Computing and Communications Lab. Load Balancing Minsoo Ryu Department of Computer Science and Engineering 2 1 Concepts of Load Balancing Page X 2 Load Balancing Algorithms Page X 3 Overhead of Load Balancing Page X 4 Load Balancing in

More information

Stacktraces in perf and ftrace. Frederic Weisbecker Collaboration summit 2012

Stacktraces in perf and ftrace. Frederic Weisbecker Collaboration summit 2012 ] Stacktraces in perf and ftrace Frederic Weisbecker Collaboration summit 2012 Raw stacktrace One shot: Used for debugging [ 328.028320] Call Trace: [ 328.028320] []

More information

<Insert Picture Here> Boost Linux Performance with Enhancements from Oracle

<Insert Picture Here> Boost Linux Performance with Enhancements from Oracle Boost Linux Performance with Enhancements from Oracle Chris Mason Director of Linux Kernel Engineering Linux Performance on Large Systems Exadata Hardware How large systems are different

More information

Lecture 5: Synchronization w/locks

Lecture 5: Synchronization w/locks Lecture 5: Synchronization w/locks CSE 120: Principles of Operating Systems Alex C. Snoeren Lab 1 Due 10/19 Threads Are Made to Share Global variables and static objects are shared Stored in the static

More information

Linux Storage System Bottleneck Exploration

Linux Storage System Bottleneck Exploration Linux Storage System Bottleneck Exploration Bean Huo / Zoltan Szubbocsev Beanhuo@micron.com / zszubbocsev@micron.com 215 Micron Technology, Inc. All rights reserved. Information, products, and/or specifications

More information

Timers 1 / 46. Jiffies. Potent and Evil Magic

Timers 1 / 46. Jiffies. Potent and Evil Magic Timers 1 / 46 Jiffies Each timer tick, a variable called jiffies is incremented It is thus (roughly) the number of HZ since system boot A 32-bit counter incremented at 1000 Hz wraps around in about 50

More information

CS3210: Coordination. Tim Andersen

CS3210: Coordination. Tim Andersen 1 CS3210: Coordination Tim Andersen 2 Administrivia Lab5 out, due November 21st Demo day: 8 min for demo, 2 min for Q&A Final project (write up): December 2nd 3 Today's plan Context switching (i.e., swtch

More information

www nfsd emacs lpr Process Management CS 537 Lecture 4: Processes Example OS in operation Why Processes? Simplicity + Speed

www nfsd emacs lpr Process Management CS 537 Lecture 4: Processes Example OS in operation Why Processes? Simplicity + Speed Process Management CS 537 Lecture 4: Processes Michael Swift This lecture begins a series of topics on processes, threads, and synchronization Today: processes and process management what are the OS units

More information

Decoding Those Inscrutable RCU CPU Stall Warnings

Decoding Those Inscrutable RCU CPU Stall Warnings Paul E. McKenney, IBM Distinguished Engineer, Linux Technology Center Member, IBM Academy of Technology linux.conf.au Kernel Miniconf, January 22, 2018 Decoding Those Inscrutable RCU CPU Stall Warnings

More information

Stanislav Bratanov; Roman Belenov; Ludmila Pakhomova 4/27/2015

Stanislav Bratanov; Roman Belenov; Ludmila Pakhomova 4/27/2015 Stanislav Bratanov; Roman Belenov; Ludmila Pakhomova 4/27/2015 What is Intel Processor Trace? Intel Processor Trace (Intel PT) provides hardware a means to trace branching, transaction, and timing information

More information

Automatic NUMA Balancing. Rik van Riel, Principal Software Engineer, Red Hat Vinod Chegu, Master Technologist, HP

Automatic NUMA Balancing. Rik van Riel, Principal Software Engineer, Red Hat Vinod Chegu, Master Technologist, HP Automatic NUMA Balancing Rik van Riel, Principal Software Engineer, Red Hat Vinod Chegu, Master Technologist, HP Automatic NUMA Balancing Agenda What is NUMA, anyway? Automatic NUMA balancing internals

More information

An Implementation Of Multiprocessor Linux

An Implementation Of Multiprocessor Linux An Implementation Of Multiprocessor Linux This document describes the implementation of a simple SMP Linux kernel extension and how to use this to develop SMP Linux kernels for architectures other than

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

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

RT Troubles. Lessons Learned & Open Questions. Grațian Crișan. RT-Summit ni.com

RT Troubles. Lessons Learned & Open Questions. Grațian Crișan. RT-Summit ni.com RT Troubles Lessons Learned & Open Questions Grațian Crișan RT-Summit 2017 gratian.crisan@ni.com, gratian@gmail.com ni.com Context National Instruments Makes hardware & software for test, measurement and

More information

Scaling Facebook. Ben Maurer

Scaling Facebook. Ben Maurer Scaling Userspace @ Facebook Ben Maurer bmaurer@fb.com! About Me At Facebook since 2010 Co-founded recaptcha Tech-lead of Web Foundation team Responsible for the overall performance & reliability of Facebook

More information

Performance Tuning Guidelines for Low Latency Response on AMD EPYC -Based Servers Application Note

Performance Tuning Guidelines for Low Latency Response on AMD EPYC -Based Servers Application Note Performance Tuning Guidelines for Low Latency Response on AMD EPYC -Based Servers Publication # 56263 Revision: 3.00 Issue Date: January 2018 Advanced Micro Devices 2018 Advanced Micro Devices, Inc. All

More information

Red Hat Enterprise MRG 1.3 Tuna User Guide

Red Hat Enterprise MRG 1.3 Tuna User Guide Red Hat Enterprise MRG 1.3 Tuna User Guide Using Tuna to perform advanced tuning procedures for the MRG Realtime component of the Red Hat Enterprise MRG distributed computing platform Edition 2 Lana Brindley

More information

The path of the private futex

The path of the private futex The path of the private futex Embedded Linux Conference Europe 2016 Sebastian A. Siewior Linutronix GmbH October 12, 2016 Sebastian A. Siewior Linutronix GmbH 1/31 Futex introduction futex.c started with

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

Computer Science 61 Scribe Notes Tuesday, November 25, 2014 (aka the day before Thanksgiving Break)

Computer Science 61 Scribe Notes Tuesday, November 25, 2014 (aka the day before Thanksgiving Break) Computer Science 61 Scribe Notes Tuesday, November 25, 2014 (aka the day before Thanksgiving Break) Problem Set 6 Released! People have fun with it Make Games Snake Game Hack JavaScript Due Wed., last

More information

PyTimechart practical. Pierre Tardy Software Engineer - UMG October 2011

PyTimechart practical. Pierre Tardy Software Engineer - UMG October 2011 PyTimechart practical Pierre Tardy Software Engineer - UMG October 2011 Intel Employee since 2009 Working on Intel s phone platforms Meego Android Power Management Tools (pytimechart, buildbot) Open-Source

More information

What is a Real Time Operating System?

What is a Real Time Operating System? What is a Real Time Operating System? Review We tentatively defined an Operating System to be: Some sort of software that you did not write yourself that allows you to use a processor effectively. What

More information

Powernightmares: The Challenge of Efficiently Using Sleep States on Multi-Core Systems

Powernightmares: The Challenge of Efficiently Using Sleep States on Multi-Core Systems Powernightmares: The Challenge of Efficiently Using Sleep States on Multi-Core Systems Thomas Ilsche, Marcus Hähnel, Robert Schöne, Mario Bielert, and Daniel Hackenberg Technische Universität Dresden Observation

More information

EECS 482 Introduction to Operating Systems

EECS 482 Introduction to Operating Systems EECS 482 Introduction to Operating Systems Winter 2018 Harsha V. Madhyastha Monitors vs. Semaphores Monitors: Custom user-defined conditions Developer must control access to variables Semaphores: Access

More information

NPTEL Course Jan K. Gopinath Indian Institute of Science

NPTEL Course Jan K. Gopinath Indian Institute of Science Storage Systems NPTEL Course Jan 2012 (Lecture 17) K. Gopinath Indian Institute of Science Accessing Devices/Device Driver Many ways to access devices under linux Non-block based devices ( char ) - stream

More information

STEPS TOWARDS A FULLY PREEMPTABLE LINUX KERNEL. Arnd C. Heursch Dirk Grambow Alexander Horstkotte Helmut Rzehak

STEPS TOWARDS A FULLY PREEMPTABLE LINUX KERNEL. Arnd C. Heursch Dirk Grambow Alexander Horstkotte Helmut Rzehak STEPS TOWARDS A FULLY PREEMPTABLE LINUX KERNEL Arnd C. Heursch Dirk Grambow Alexander Horstkotte Helmut Rzehak Department of Computer Science, University of Federal Armed Forces, Munich, Werner-Heisenberg-Weg

More information

What s in a process?

What s in a process? CSE 451: Operating Systems Winter 2015 Module 5 Threads Mark Zbikowski mzbik@cs.washington.edu Allen Center 476 2013 Gribble, Lazowska, Levy, Zahorjan What s in a process? A process consists of (at least):

More information

Impact on Application Development: SNIA NVM Programming Model in the Real World. Andy Rudoff pmem SW Architect, Intel

Impact on Application Development: SNIA NVM Programming Model in the Real World. Andy Rudoff pmem SW Architect, Intel Impact on Development: SNIA NVM Programming Model in the Real World Andy Rudoff pmem SW Architect, Intel Agenda What everyone already knows about pmem What everyone forgets Ways to use pmem with no app

More information