"Controlling a laser with Linux is crazy, but everyone in this room is crazy in his own way. So if you want to use Linux to control an industrial welding laser, I have no problem with your using PREEMPT_RT." -- Linus Torvalds
Linux PREEMPT_RT improves the preemptiveness of the Linux kernel by allowing preemption everywhere except when preemption is disabled or interrupts are disabled. This reduces latency from preemption, critical sections, and interrupts. However, non-deterministic external interrupt events and timing as well as interrupt collisions can still cause unpredictable latency. Tracing tools can help analyze latency but practical issues remain in fully guaranteeing hard real-time behavior.
Solving Real-Time Scheduling Problems With RT_PREEMPT and Deadline-Based Sche...peknap
In dealing with a real world problem of scheduling three classes of tasks – network packet forwarding, voice over IP and application level services for a home gateway device, the author found that mechanisms coming with vanilla Linux kernel are not enough. This talk will cover the unique real-time requirements for each task class, why moving softirq to process context with RT_PREEMPT patch is an important step in solving the problem and how a deadline based process scheduler would be a better solution than regular real-time scheduling classes.
This document provides an introduction to real-time systems and discusses approaches to making Linux a real-time operating system. It defines hard and soft real-time systems and explains why Linux is commonly used instead of dedicated real-time operating systems. The document then discusses two main solutions, PREEMPT_RT and Xenomai 3, which provide patches to make Linux meet timing constraints through different approaches. It also provides an overview of basic real-time concepts like scheduling algorithms, preemptive vs. non-preemptive scheduling, and interprocess communication.
HKG15-305: Real Time processing comparing the RT patch vs Core isolationLinaro
HKG15-305: Real Time processing comparing the RT patch vs Core isolation
---------------------------------------------------
Speaker: Gary Robertson
Date: February 11, 2015
---------------------------------------------------
★ Session Summary ★
Give high level overview of the components involved in a DRM/Secure. Playback use case. Presentation discusses about how Client device obtains License Keys using W3C-EME implementation of any particular DRM like Widevine, how content is decrypted, decoded and rendered and how the buffers are allocated, secured and shared among various elements in the secure playback chain.
--------------------------------------------------
★ Resources ★
Pathable: https://hkg15.pathable.com/meetings/250810
Video: https://www.youtube.com/watch?v=zC3E9xizkoY
Etherpad: http://pad.linaro.org/p/hkg15-305
---------------------------------------------------
★ Event Details ★
Linaro Connect Hong Kong 2015 - #HKG15
February 9-13th, 2015
Regal Airport Hotel Hong Kong Airport
---------------------------------------------------
http://www.linaro.org
http://connect.linaro.org
Testing real-time Linux. What to test and how Chirag Jog
The document discusses testing of the real-time Linux kernel. It explains that real-time kernel testing focuses on functionality, performance, and latency. Key aspects to test include signal delivery latency, scheduling jitter, and context switch duration. Proper hardware setup and kernel configuration are important. Test cases should run as real-time processes and avoid page faults, disk I/O, and other sources of unpredictable latency when measuring real-time performance.
This slides indicate an introduction on the definition of real time and RTOSes, then you can find information on introducing RT Linux approaches and comparing them with each other, then finally you can see a latency measurement test done by "Linutronix" in the slides
Analysis of interrupt latencies in a real-time kernelGabriele Modena
This document analyzes interrupt latencies in a real-time kernel. It discusses how real-time operating systems must ensure operations complete within fixed deadlines to maintain predictability. When dealing with device drivers, this implies managing race conditions and fulfilling temporal constraints. The document evaluates the performance of the Linux real-time preempt patch using cyclictest to measure latency and compares its performance to the standard Linux kernel.
This document discusses real-time solutions in Linux. It explains that real-time systems focus on determinism, ensuring events and timing are known. There are several approaches to real-time Linux, including dual kernel systems like RTLinux that run a real-time kernel alongside Linux, and PREEMPT_RT kernels that modify Linux for lower latencies. Popular dual kernel options are RTAI and Xenomai, which provide real-time cores on top of Linux. RTAI focuses on x86 while Xenomai aims to facilitate porting and supports multiple personality "skins". The document provides references for further information on these real-time Linux solutions.
Linux PREEMPT_RT improves the preemptiveness of the Linux kernel by allowing preemption everywhere except when preemption is disabled or interrupts are disabled. This reduces latency from preemption, critical sections, and interrupts. However, non-deterministic external interrupt events and timing as well as interrupt collisions can still cause unpredictable latency. Tracing tools can help analyze latency but practical issues remain in fully guaranteeing hard real-time behavior.
Solving Real-Time Scheduling Problems With RT_PREEMPT and Deadline-Based Sche...peknap
In dealing with a real world problem of scheduling three classes of tasks – network packet forwarding, voice over IP and application level services for a home gateway device, the author found that mechanisms coming with vanilla Linux kernel are not enough. This talk will cover the unique real-time requirements for each task class, why moving softirq to process context with RT_PREEMPT patch is an important step in solving the problem and how a deadline based process scheduler would be a better solution than regular real-time scheduling classes.
This document provides an introduction to real-time systems and discusses approaches to making Linux a real-time operating system. It defines hard and soft real-time systems and explains why Linux is commonly used instead of dedicated real-time operating systems. The document then discusses two main solutions, PREEMPT_RT and Xenomai 3, which provide patches to make Linux meet timing constraints through different approaches. It also provides an overview of basic real-time concepts like scheduling algorithms, preemptive vs. non-preemptive scheduling, and interprocess communication.
HKG15-305: Real Time processing comparing the RT patch vs Core isolationLinaro
HKG15-305: Real Time processing comparing the RT patch vs Core isolation
---------------------------------------------------
Speaker: Gary Robertson
Date: February 11, 2015
---------------------------------------------------
★ Session Summary ★
Give high level overview of the components involved in a DRM/Secure. Playback use case. Presentation discusses about how Client device obtains License Keys using W3C-EME implementation of any particular DRM like Widevine, how content is decrypted, decoded and rendered and how the buffers are allocated, secured and shared among various elements in the secure playback chain.
--------------------------------------------------
★ Resources ★
Pathable: https://hkg15.pathable.com/meetings/250810
Video: https://www.youtube.com/watch?v=zC3E9xizkoY
Etherpad: http://pad.linaro.org/p/hkg15-305
---------------------------------------------------
★ Event Details ★
Linaro Connect Hong Kong 2015 - #HKG15
February 9-13th, 2015
Regal Airport Hotel Hong Kong Airport
---------------------------------------------------
http://www.linaro.org
http://connect.linaro.org
Testing real-time Linux. What to test and how Chirag Jog
The document discusses testing of the real-time Linux kernel. It explains that real-time kernel testing focuses on functionality, performance, and latency. Key aspects to test include signal delivery latency, scheduling jitter, and context switch duration. Proper hardware setup and kernel configuration are important. Test cases should run as real-time processes and avoid page faults, disk I/O, and other sources of unpredictable latency when measuring real-time performance.
This slides indicate an introduction on the definition of real time and RTOSes, then you can find information on introducing RT Linux approaches and comparing them with each other, then finally you can see a latency measurement test done by "Linutronix" in the slides
Analysis of interrupt latencies in a real-time kernelGabriele Modena
This document analyzes interrupt latencies in a real-time kernel. It discusses how real-time operating systems must ensure operations complete within fixed deadlines to maintain predictability. When dealing with device drivers, this implies managing race conditions and fulfilling temporal constraints. The document evaluates the performance of the Linux real-time preempt patch using cyclictest to measure latency and compares its performance to the standard Linux kernel.
This document discusses real-time solutions in Linux. It explains that real-time systems focus on determinism, ensuring events and timing are known. There are several approaches to real-time Linux, including dual kernel systems like RTLinux that run a real-time kernel alongside Linux, and PREEMPT_RT kernels that modify Linux for lower latencies. Popular dual kernel options are RTAI and Xenomai, which provide real-time cores on top of Linux. RTAI focuses on x86 while Xenomai aims to facilitate porting and supports multiple personality "skins". The document provides references for further information on these real-time Linux solutions.
The Linux Scheduler: a Decade of Wasted Coresyeokm1
The talk I gave at Papers We Love #20 (Singapore) about this academic paper "The Linux Scheduler: a Decade of Wasted Cores" by a few researchers.
The video of this talk can be found here: https://engineers.sg/v/758
Here are some relevant links:
Paper: http://www.ece.ubc.ca/~sasha/papers/eurosys16-final29.pdf
Reference Slides: http://www.i3s.unice.fr/~jplozi/wastedcores/files/extended_talk.pdf
Reference summary: https://blog.acolyer.org/2016/04/26/the-linux-scheduler-a-decade-of-wasted-cores/
This presentation covers the general concepts about real-time systems, how Linux kernel works for preemption, the latency in Linux, rt-preempt, and Xenomai, the real-time extension as the dual kernel approach.
This document discusses the challenges of real-time computing on Linux and potential solutions. Real-time means very low maximum latency, below 100 microseconds. While Linux was not designed for real-time, it is now used in many embedded systems. Options to address real-time include using separate hardware, a hypervisor with an real-time operating system (RTOS), asymmetric multiprocessing (AMP) with an RTOS, or solutions within Linux like PREEMPT_RT that adds preemption and CPU isolation techniques to reduce worst-case latency without changing applications. The document reviews these approaches and notes that real-time remains an important area as Linux is increasingly used in embedded systems.
This document discusses real-time operating systems (RTOS) for Cortex-M microcontrollers. It covers topics like RTOS concepts, memory management, scheduling, inter-process communication, hardware support for RTOS, and security considerations. Examples of RTOS like ARM mbed, Arduino scheduler, RTX are discussed. The document also talks about trade-offs for RTOS design involving complexity, performance and power consumption.
In this talk Liran will discuss interrupt management in Linux, effective handling, how to defer work using tasklets, workqueues and timers. We'll learn how to handle interrupts in userspace and talk about the performance and latency aspects of each method as well as look at some examples from the kernel source.
Liran is the CTO at Mabel technology and co-founder of DiscoverSDK - Software Libraries directory and DiscoverCloud - Business Apps directory.
More than 20 years of training experience including courses in: Linux, Android, Real-time and Embedded systems, and many more.
IRQs: the Hard, the Soft, the Threaded and the PreemptibleAlison Chaiken
The Linux kernel supports a diverse set of interrupt handlers that partition work into immediate and deferred tasks. The talk introduces the major varieties and explains how IRQs differ in the real-time kernel.
This document provides an overview comparing NetBSD and Linux operating systems for embedded systems. Both systems are highly portable and POSIX compliant, with active development, but they differ in key areas like memory footprint, process scheduling, threading models, debugging support, and availability of drivers. NetBSD emphasizes reduced size and portability while Linux prioritizes functionality and third-party support. The document examines features and tradeoffs to help choose between the two for embedded applications.
USENIX ATC 2017 Performance Superpowers with Enhanced BPFBrendan Gregg
Talk for USENIX ATC 2017 by Brendan Gregg
"The Berkeley Packet Filter (BPF) in Linux has been enhanced in very recent versions to do much more than just filter packets, and has become a hot area of operating systems innovation, with much more yet to be discovered. BPF is a sandboxed virtual machine that runs user-level defined programs in kernel context, and is part of many kernels. The Linux enhancements allow it to run custom programs on other events, including kernel- and user-level dynamic tracing (kprobes and uprobes), static tracing (tracepoints), and hardware events. This is finding uses for the generation of new performance analysis tools, network acceleration technologies, and security intrusion detection systems.
This talk will explain the BPF enhancements, then discuss the new performance observability tools that are in use and being created, especially from the BPF compiler collection (bcc) open source project. These tools provide new insights for file system and storage performance, CPU scheduler performance, TCP performance, and much more. This is a major turning point for Linux systems engineering, as custom advanced performance instrumentation can be used safely in production environments, powering a new generation of tools and visualizations.
Because these BPF enhancements are only in very recent Linux (such as Linux 4.9), most companies are not yet running new enough kernels to be exploring BPF yet. This will change in the next year or two, as companies including Netflix upgrade their kernels. This talk will give you a head start on this growing technology, and also discuss areas of future work and unsolved problems."
Linux Performance Analysis: New Tools and Old SecretsBrendan Gregg
Talk for USENIX/LISA2014 by Brendan Gregg, Netflix. At Netflix performance is crucial, and we use many high to low level tools to analyze our stack in different ways. In this talk, I will introduce new system observability tools we are using at Netflix, which I've ported from my DTraceToolkit, and are intended for our Linux 3.2 cloud instances. These show that Linux can do more than you may think, by using creative hacks and workarounds with existing kernel features (ftrace, perf_events). While these are solving issues on current versions of Linux, I'll also briefly summarize the future in this space: eBPF, ktap, SystemTap, sysdig, etc.
Talk from Embedded Linux Conference, http://elcabs2015.sched.org/event/551ba3cdefe2d37c478810ef47d4ca4c?iframe=no&w=i:0;&sidebar=yes&bg=no#.VRUCknSQQQs
This document discusses stateless hypervisors that are booted from a live image rather than persisting to local storage. Some key points:
- Rackspace uses stateless hypervisors booted from a network image to improve consistency and allow easy updating of all servers.
- The hypervisors are built using Ansible from a base operating system chroot. Common configurations are applied and different "personalities" like KVM or Xen are configured.
- Servers boot the image over the network using iPXE or locally using GRUB. The image runs in memory and mounts persistent storage.
- This approach allows rapid, consistent provisioning of thousands of hypervisors across different hardware with reproducible builds.
From USENIX LISA 2010, San Jose.
Visualizations that include heat maps can be an effective way to present performance data: I/O latency, resource utilization, and more. Patterns can emerge that would be difficult to notice from columns of numbers or line graphs, which are revealing previously unknown behavior. These visualizations are used in a product as a replacement for traditional metrics such as %CPU and are allowing end users to identify more issues much more easily (and some issues are becoming nearly impossible to identify with tools such as vmstat(1)). This talk covers what has been learned, crazy heat map discoveries, and thoughts for future applications beyond performance analysis.
Agenda:
The Linux kernel has multiple "tracers" built-in, with various degrees of support for aggregation, dynamic probes, parameter processing, filtering, histograms, and other features. Starting from the venerable ftrace, introduced in kernel 2.6, all the way through eBPF, which is still under development, there are many options to choose from when you need to statically instrument your software with probes, or diagnose issues in the field using the system's dynamic probes. Modern tools include SystemTap, Sysdig, ktap, perf, bcc, and others. In this talk, we will begin by reviewing the modern tracing landscape -- ftrace, perf_events, kprobes, uprobes, eBPF -- and what insight into system activity these tools can offer. Then, we will look at specific examples of using tracing tools for diagnostics: tracing a memory leak using low-overhead kmalloc/kfree instrumentation, diagnosing a CPU caching issue using perf stat, probing network and block I/O latency distributions under load, or merely snooping user activities by capturing terminal input and output.
Speaker:
Sasha is the CTO of Sela Group, a training and consulting company based in Israel that employs over 400 developers world-wide. Most of Sasha's work revolves around performance optimization, production debugging, and low-level system diagnostics, but he also dabbles in mobile application development on iOS and Android. Sasha is the author of two books and three Pluralsight courses, and a contributor to multiple open-source projects. He blogs at http://blog.sashag.net.
AOS Lab 8: Interrupts and Device DriversZubair Nabi
This document discusses interrupts, device drivers, and the xv6 operating system. It provides recaps of previous labs on extraordinary events like interrupts, exceptions, and system calls. It explains how interrupts are handled on multi-processor systems using the I/O APIC to route interrupts and the LAPIC as a per-CPU interrupt controller. An example is given of how timer interrupts are used to track time and scheduling. Device drivers are introduced as code that manages devices by providing interrupt handlers and controlling device operations. The disk driver is given as an example to copy data between disk and memory in 512-byte sectors.
Dead Lock Analysis of spin_lock() in Linux Kernel (english)Sneeker Yeh
The document discusses spin locks and semaphores in the Linux kernel. It begins with an introduction to the difference between spin locks and semaphores. Spin locks cause threads to continuously loop trying to acquire the lock, while semaphores cause threads to sleep. An example is given of a deadlock scenario that can occur with spin locks. The document then discusses the concept of context in the kernel, including user context, interrupt context, and the control flow during procedure calls and interrupts. Log analysis and examples of double-acquire deadlocks involving spin locks are provided. The document concludes with recommendations for how to prevent deadlocks, such as using spin_lock_irqsave/restore and avoiding semaphores in interrupt context.
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecksAnne Nicolas
lash devices introduced a sudden shift in the performance profile of direct attached storage. With IOPS rates orders of magnitude higher than rotating storage, it became clear that Linux needed a re-design of its storage stack to properly support and get the most out of these new devices.
This talk will detail the architecture of blk-mq, the redesign of the core of the Linux storage stack, and the later set of changes made to adapt the SCSI stack to this new queuing model. Early results of running Facebook infrastructure production workloads on top of the new stack will also be shared.
Jense Axboe, Facebook
The document discusses process scheduling in an operating system. It describes how an OS runs more processes than it has processors by providing each process with a virtual processor and multiplexing these across physical processors. When a process performs I/O or its time quantum expires, the scheduler selects another process to run using a timer interrupt. Context switching involves saving the context of the current process and restoring the next process using the swtch function. The scheduler runs in a loop, acquiring the process table lock to select a RUNNABLE process and releasing it to allow other CPUs access between iterations.
Agenda:
In this talk we will present various locking mechanisms implemented in the linux kernel.
From System V locks to raw spinlocks and the RT patch.
Speaker:
Mark Veltzer - CTO of Hinbit and a senior instructor at John Bryce. Mark is also a member of the Free Source Foundation and contributes to many free projects.
https://github.com/veltzer
- Systemd is now the most widely used Linux init system, replacing sysVinit. It has a superior design with tight integration with the Linux kernel.
- Systemd aims to extract duplicate functionality from individual daemons and replace init scripts with declarative configuration files. It provides a single daemon, systemd, to manage all system services.
- While systemd exemplifies needed modernization of Linux, its rapid development and deprecation of features could cause problems during the transition by distributions.
This document proposes transforming parallel runtimes into operating system kernels to improve performance and scalability. It discusses how modern runtimes run on top of general purpose OSes and are limited by the kernel abstraction. A hybrid runtime integrated with a small prototype kernel called Nautilus could run entirely in kernel mode without syscall overhead and access advanced hardware features. It describes porting the Legion runtime to Nautilus and shows improved performance from reduced interrupts in initial evaluations. The conclusion is that parallel runtimes can be transformed into kernels to easily leverage kernel resources while sometimes a full kernel is not needed.
The Linux Scheduler: a Decade of Wasted Coresyeokm1
The talk I gave at Papers We Love #20 (Singapore) about this academic paper "The Linux Scheduler: a Decade of Wasted Cores" by a few researchers.
The video of this talk can be found here: https://engineers.sg/v/758
Here are some relevant links:
Paper: http://www.ece.ubc.ca/~sasha/papers/eurosys16-final29.pdf
Reference Slides: http://www.i3s.unice.fr/~jplozi/wastedcores/files/extended_talk.pdf
Reference summary: https://blog.acolyer.org/2016/04/26/the-linux-scheduler-a-decade-of-wasted-cores/
This presentation covers the general concepts about real-time systems, how Linux kernel works for preemption, the latency in Linux, rt-preempt, and Xenomai, the real-time extension as the dual kernel approach.
This document discusses the challenges of real-time computing on Linux and potential solutions. Real-time means very low maximum latency, below 100 microseconds. While Linux was not designed for real-time, it is now used in many embedded systems. Options to address real-time include using separate hardware, a hypervisor with an real-time operating system (RTOS), asymmetric multiprocessing (AMP) with an RTOS, or solutions within Linux like PREEMPT_RT that adds preemption and CPU isolation techniques to reduce worst-case latency without changing applications. The document reviews these approaches and notes that real-time remains an important area as Linux is increasingly used in embedded systems.
This document discusses real-time operating systems (RTOS) for Cortex-M microcontrollers. It covers topics like RTOS concepts, memory management, scheduling, inter-process communication, hardware support for RTOS, and security considerations. Examples of RTOS like ARM mbed, Arduino scheduler, RTX are discussed. The document also talks about trade-offs for RTOS design involving complexity, performance and power consumption.
In this talk Liran will discuss interrupt management in Linux, effective handling, how to defer work using tasklets, workqueues and timers. We'll learn how to handle interrupts in userspace and talk about the performance and latency aspects of each method as well as look at some examples from the kernel source.
Liran is the CTO at Mabel technology and co-founder of DiscoverSDK - Software Libraries directory and DiscoverCloud - Business Apps directory.
More than 20 years of training experience including courses in: Linux, Android, Real-time and Embedded systems, and many more.
IRQs: the Hard, the Soft, the Threaded and the PreemptibleAlison Chaiken
The Linux kernel supports a diverse set of interrupt handlers that partition work into immediate and deferred tasks. The talk introduces the major varieties and explains how IRQs differ in the real-time kernel.
This document provides an overview comparing NetBSD and Linux operating systems for embedded systems. Both systems are highly portable and POSIX compliant, with active development, but they differ in key areas like memory footprint, process scheduling, threading models, debugging support, and availability of drivers. NetBSD emphasizes reduced size and portability while Linux prioritizes functionality and third-party support. The document examines features and tradeoffs to help choose between the two for embedded applications.
USENIX ATC 2017 Performance Superpowers with Enhanced BPFBrendan Gregg
Talk for USENIX ATC 2017 by Brendan Gregg
"The Berkeley Packet Filter (BPF) in Linux has been enhanced in very recent versions to do much more than just filter packets, and has become a hot area of operating systems innovation, with much more yet to be discovered. BPF is a sandboxed virtual machine that runs user-level defined programs in kernel context, and is part of many kernels. The Linux enhancements allow it to run custom programs on other events, including kernel- and user-level dynamic tracing (kprobes and uprobes), static tracing (tracepoints), and hardware events. This is finding uses for the generation of new performance analysis tools, network acceleration technologies, and security intrusion detection systems.
This talk will explain the BPF enhancements, then discuss the new performance observability tools that are in use and being created, especially from the BPF compiler collection (bcc) open source project. These tools provide new insights for file system and storage performance, CPU scheduler performance, TCP performance, and much more. This is a major turning point for Linux systems engineering, as custom advanced performance instrumentation can be used safely in production environments, powering a new generation of tools and visualizations.
Because these BPF enhancements are only in very recent Linux (such as Linux 4.9), most companies are not yet running new enough kernels to be exploring BPF yet. This will change in the next year or two, as companies including Netflix upgrade their kernels. This talk will give you a head start on this growing technology, and also discuss areas of future work and unsolved problems."
Linux Performance Analysis: New Tools and Old SecretsBrendan Gregg
Talk for USENIX/LISA2014 by Brendan Gregg, Netflix. At Netflix performance is crucial, and we use many high to low level tools to analyze our stack in different ways. In this talk, I will introduce new system observability tools we are using at Netflix, which I've ported from my DTraceToolkit, and are intended for our Linux 3.2 cloud instances. These show that Linux can do more than you may think, by using creative hacks and workarounds with existing kernel features (ftrace, perf_events). While these are solving issues on current versions of Linux, I'll also briefly summarize the future in this space: eBPF, ktap, SystemTap, sysdig, etc.
Talk from Embedded Linux Conference, http://elcabs2015.sched.org/event/551ba3cdefe2d37c478810ef47d4ca4c?iframe=no&w=i:0;&sidebar=yes&bg=no#.VRUCknSQQQs
This document discusses stateless hypervisors that are booted from a live image rather than persisting to local storage. Some key points:
- Rackspace uses stateless hypervisors booted from a network image to improve consistency and allow easy updating of all servers.
- The hypervisors are built using Ansible from a base operating system chroot. Common configurations are applied and different "personalities" like KVM or Xen are configured.
- Servers boot the image over the network using iPXE or locally using GRUB. The image runs in memory and mounts persistent storage.
- This approach allows rapid, consistent provisioning of thousands of hypervisors across different hardware with reproducible builds.
From USENIX LISA 2010, San Jose.
Visualizations that include heat maps can be an effective way to present performance data: I/O latency, resource utilization, and more. Patterns can emerge that would be difficult to notice from columns of numbers or line graphs, which are revealing previously unknown behavior. These visualizations are used in a product as a replacement for traditional metrics such as %CPU and are allowing end users to identify more issues much more easily (and some issues are becoming nearly impossible to identify with tools such as vmstat(1)). This talk covers what has been learned, crazy heat map discoveries, and thoughts for future applications beyond performance analysis.
Agenda:
The Linux kernel has multiple "tracers" built-in, with various degrees of support for aggregation, dynamic probes, parameter processing, filtering, histograms, and other features. Starting from the venerable ftrace, introduced in kernel 2.6, all the way through eBPF, which is still under development, there are many options to choose from when you need to statically instrument your software with probes, or diagnose issues in the field using the system's dynamic probes. Modern tools include SystemTap, Sysdig, ktap, perf, bcc, and others. In this talk, we will begin by reviewing the modern tracing landscape -- ftrace, perf_events, kprobes, uprobes, eBPF -- and what insight into system activity these tools can offer. Then, we will look at specific examples of using tracing tools for diagnostics: tracing a memory leak using low-overhead kmalloc/kfree instrumentation, diagnosing a CPU caching issue using perf stat, probing network and block I/O latency distributions under load, or merely snooping user activities by capturing terminal input and output.
Speaker:
Sasha is the CTO of Sela Group, a training and consulting company based in Israel that employs over 400 developers world-wide. Most of Sasha's work revolves around performance optimization, production debugging, and low-level system diagnostics, but he also dabbles in mobile application development on iOS and Android. Sasha is the author of two books and three Pluralsight courses, and a contributor to multiple open-source projects. He blogs at http://blog.sashag.net.
AOS Lab 8: Interrupts and Device DriversZubair Nabi
This document discusses interrupts, device drivers, and the xv6 operating system. It provides recaps of previous labs on extraordinary events like interrupts, exceptions, and system calls. It explains how interrupts are handled on multi-processor systems using the I/O APIC to route interrupts and the LAPIC as a per-CPU interrupt controller. An example is given of how timer interrupts are used to track time and scheduling. Device drivers are introduced as code that manages devices by providing interrupt handlers and controlling device operations. The disk driver is given as an example to copy data between disk and memory in 512-byte sectors.
Dead Lock Analysis of spin_lock() in Linux Kernel (english)Sneeker Yeh
The document discusses spin locks and semaphores in the Linux kernel. It begins with an introduction to the difference between spin locks and semaphores. Spin locks cause threads to continuously loop trying to acquire the lock, while semaphores cause threads to sleep. An example is given of a deadlock scenario that can occur with spin locks. The document then discusses the concept of context in the kernel, including user context, interrupt context, and the control flow during procedure calls and interrupts. Log analysis and examples of double-acquire deadlocks involving spin locks are provided. The document concludes with recommendations for how to prevent deadlocks, such as using spin_lock_irqsave/restore and avoiding semaphores in interrupt context.
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecksAnne Nicolas
lash devices introduced a sudden shift in the performance profile of direct attached storage. With IOPS rates orders of magnitude higher than rotating storage, it became clear that Linux needed a re-design of its storage stack to properly support and get the most out of these new devices.
This talk will detail the architecture of blk-mq, the redesign of the core of the Linux storage stack, and the later set of changes made to adapt the SCSI stack to this new queuing model. Early results of running Facebook infrastructure production workloads on top of the new stack will also be shared.
Jense Axboe, Facebook
The document discusses process scheduling in an operating system. It describes how an OS runs more processes than it has processors by providing each process with a virtual processor and multiplexing these across physical processors. When a process performs I/O or its time quantum expires, the scheduler selects another process to run using a timer interrupt. Context switching involves saving the context of the current process and restoring the next process using the swtch function. The scheduler runs in a loop, acquiring the process table lock to select a RUNNABLE process and releasing it to allow other CPUs access between iterations.
Agenda:
In this talk we will present various locking mechanisms implemented in the linux kernel.
From System V locks to raw spinlocks and the RT patch.
Speaker:
Mark Veltzer - CTO of Hinbit and a senior instructor at John Bryce. Mark is also a member of the Free Source Foundation and contributes to many free projects.
https://github.com/veltzer
- Systemd is now the most widely used Linux init system, replacing sysVinit. It has a superior design with tight integration with the Linux kernel.
- Systemd aims to extract duplicate functionality from individual daemons and replace init scripts with declarative configuration files. It provides a single daemon, systemd, to manage all system services.
- While systemd exemplifies needed modernization of Linux, its rapid development and deprecation of features could cause problems during the transition by distributions.
This document proposes transforming parallel runtimes into operating system kernels to improve performance and scalability. It discusses how modern runtimes run on top of general purpose OSes and are limited by the kernel abstraction. A hybrid runtime integrated with a small prototype kernel called Nautilus could run entirely in kernel mode without syscall overhead and access advanced hardware features. It describes porting the Legion runtime to Nautilus and shows improved performance from reduced interrupts in initial evaluations. The conclusion is that parallel runtimes can be transformed into kernels to easily leverage kernel resources while sometimes a full kernel is not needed.
-> Deep dive inside the kernel Interrupt management subsystem.
-> Entire presentation is oriented towards 8259 Interrupt controller.
-> Detail understanding of how request_irq() function works.
Signals are software interrupts that give us a way to handle asynchronous events.Stuck with your System Programming Assignment. Get 24/7 help from tutors with Phd in the subject. Email us at support@helpwithassignment.com
Reach us at http://www.HelpWithAssignment.com
This document provides an overview of real-time operating systems and VxWorks. It discusses key concepts such as real-time performance, deterministic execution, multitasking, task scheduling and inter-task communication methods. VxWorks is introduced as a real-time OS that supports multitasking, priorities, interrupts and inter-task communication using mechanisms like shared memory, semaphores and message queues. The document also covers task management functions and interrupt handling in VxWorks.
This presentation is about a methodology which allows patching of a running Linux kernel, its technical details, limitations as well as kpatch tools.
The talk was delivered by Ruslan Bilovol (Associate Manager, Consultant, GlobalLogic) at GlobalLogic Embedded Career Day #2 on February 10, 2018.
More about GlobalLogic Embedded Career Day #2: https://www.globallogic.com/ua/events/globallogic-kyiv-embedded-career-day-2-materials
This document discusses operating systems and their core abstractions like uninterrupted computation, infinite memory, and simple I/O. It describes how operating systems provide these abstractions using mechanisms like context switching, virtual memory, and system calls. It also covers different types of operating systems and characteristics of embedded operating systems like real-time capabilities.
This document discusses a presentation on practical Windows kernel exploitation. It covers the basics of kernel exploitation, common vulnerability classes like write-what-where and use-after-free, techniques for executing code, mitigation technologies, writing Windows kernel exploits for Metasploit, and improving reliability. The speaker works at SecureState researching and developing kernel exploits and is an open source contributor to projects like Metasploit.
- Windows uses four privilege rings (0-3) to separate kernel and user modes, with ring 0 having the most privileges for kernel code. System calls transition from user mode to kernel mode via an interrupt.
- The kernel maintains system call tables that are accessed via interrupts to call functions like NtWriteFile. I/O requests use IRPs to contain request information as it passes through drivers.
- Memory is divided between kernel and user address spaces, with paged and nonpaged pools for kernel allocations. Interrupts have prioritized IRQL levels, with DPCs deferring work from ISRs and APCs transferring data to user threads.
Deployment of WebObjects applications on CentOS LinuxWO Community
With the rise of cloud computing and the death of the Xserve, learn how you can deploy your WebObjects applications on a CentOS server. You will also get tips about how to secure your server so that you don't get hack.
Metasploit & Windows Kernel ExploitationzeroSteiner
The document discusses kernel exploitation on Windows systems. It provides an overview of common vulnerability classes like write-what-where and use-after-free. It also covers techniques for executing code, mitigation technologies, writing exploits for Metasploit, and sources of instability. The speaker's background and agenda are introduced at the start.
This document provides an overview of operating system basics. It defines an operating system as an intermediary between the computer user and hardware that manages system resources and makes the hardware convenient to use. It describes the basic components of a computer system including the CPU, memory, disk, and I/O devices. It also explains key operating system concepts such as multitasking, interrupts, system calls, boot process, and protection and security.
This document provides an overview of operating system basics. It defines an operating system as an intermediary between the computer user and hardware that manages system resources and makes the hardware convenient to use. It describes the basic components of a computer system including the CPU, memory, disk, and I/O devices. It also covers operating system concepts such as multitasking, interrupts, system calls, startup process, and OS philosophies regarding microkernels vs macrokernels.
Xen Project is a static partitioning hypervisor for embedded deployments (industrial, medical, etc.) Xen enforces strong isolation between domains so that one cannot affect the execution of another. Features such as cache coloring reduce interference and improve interrupt latency and determinism. A real-time workload can run alongside a more complex guest. But can it be used in safety-critical environments? The Xen hypervisor has a microkernel design: services and tools are non-essential and run in unprivileged VMs, while the core is less than 50K LOC. This architecture lends itself well to safety-critical applications as only the core is critical and needs to go through the certification process. This presentation will describe the activities of the Xen FuSa SIG (Special Interest Group) to make Xen easier to safety-certify. It will go through the aspects of Xen that pertain safety and it will explain how to set up a mixed-criticality system with Xen. The talk will discuss the challenges of making an Open Source project safety-certifiable and the progress that the Xen community made so far in the areas of documentation and requirements, MISRA-C code compliance, and interference reduction.
This document discusses real-time Linux programming. It defines real-time as systems that must guarantee response times within strict deadlines, from milliseconds to microseconds. Real-time hardware uses a hardware clock to guarantee timing. Real-time software can be written in any language but C and C++ are preferred. Linux supports real-time capabilities through patches that improve scheduling and reduce latency. The document discusses avoiding page faults, limiting interrupts, and measuring latency in real-time systems.
Everybody knows the lock keyword, but how does it implemented? What are its performance characteristics. Gael Fraiteur scratches the surface of multithreaded programming in .NET and goes deep through the Windows Kernel down to CPU microarchitecture.
The objectives of Multithreaded Programming in Operating Systems are:
- To introduce the notion of a thread—a fundamental unit of CPU utilization that forms the basis of multithreaded computer systems.
- To discuss the APIs for the Pthreads, Windows, and Java thread libraries
- To explore several strategies that provide implicit threading.
- To examine issues related to multithreaded programming.
- To cover operating system support for threads in Windows and Linux.
This presentation by Stanislav Donets (Lead Software Engineer, Consultant, GlobalLogic, Kharkiv) was delivered at GlobalLogic Kharkiv C++ Workshop #1 on September 14, 2019.
In this talk were covered:
- Graphics Processing Units: Architecture and Programming (theory).
- Scratch Example: Barnes Hut n-Body Algorithm (practice).
Conference materials: https://www.globallogic.com/ua/events/kharkiv-cpp-workshop/
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...CanSecWest
This document discusses using Intel Processor Trace (Intel PT) for hardware-based tracing on Windows. It provides an overview of Intel PT capabilities and how it can be used for fuzzing and vulnerability discovery. Specifically, it describes the development of WinAFL IntelPT, which integrates Intel PT tracing with the WinAFL evolutionary fuzzer to enable high-performance, hardware-driven fuzzing on Windows.
This document discusses criteria for CPU scheduling and optimization in operating systems. It covers metrics like CPU utilization, throughput, turnaround time, and waiting time. The key goals of optimization are to maximize CPU usage and throughput while minimizing times. Real-time requirements can be soft or hard, with hard deadlines requiring failure prevention. Real-time kernels provide benefits like abstraction of timing, modularity, and improved efficiency. Linux uses scheduling algorithms like FIFO, round robin, and completely fair scheduling to optimize these metrics.
Graspan: A Big Data System for Big Code AnalysisAftab Hussain
We built a disk-based parallel graph system, Graspan, that uses a novel edge-pair centric computation model to compute dynamic transitive closures on very large program graphs.
We implement context-sensitive pointer/alias and dataflow analyses on Graspan. An evaluation of these analyses on large codebases such as Linux shows that their Graspan implementations scale to millions of lines of code and are much simpler than their original implementations.
These analyses were used to augment the existing checkers; these augmented checkers found 132 new NULL pointer bugs and 1308 unnecessary NULL tests in Linux 4.4.0-rc5, PostgreSQL 8.3.9, and Apache httpd 2.2.18.
- Accepted in ASPLOS ‘17, Xi’an, China.
- Featured in the tutorial, Systemized Program Analyses: A Big Data Perspective on Static Analysis Scalability, ASPLOS ‘17.
- Invited for presentation at SoCal PLS ‘16.
- Invited for poster presentation at PLDI SRC ‘16.
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppGoogle
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-fusion-buddy-review
AI Fusion Buddy Review: Key Features
✅Create Stunning AI App Suite Fully Powered By Google's Latest AI technology, Gemini
✅Use Gemini to Build high-converting Converting Sales Video Scripts, ad copies, Trending Articles, blogs, etc.100% unique!
✅Create Ultra-HD graphics with a single keyword or phrase that commands 10x eyeballs!
✅Fully automated AI articles bulk generation!
✅Auto-post or schedule stunning AI content across all your accounts at once—WordPress, Facebook, LinkedIn, Blogger, and more.
✅With one keyword or URL, generate complete websites, landing pages, and more…
✅Automatically create & sell AI content, graphics, websites, landing pages, & all that gets you paid non-stop 24*7.
✅Pre-built High-Converting 100+ website Templates and 2000+ graphic templates logos, banners, and thumbnail images in Trending Niches.
✅Say goodbye to wasting time logging into multiple Chat GPT & AI Apps once & for all!
✅Save over $5000 per year and kick out dependency on third parties completely!
✅Brand New App: Not available anywhere else!
✅ Beginner-friendly!
✅ZERO upfront cost or any extra expenses
✅Risk-Free: 30-Day Money-Back Guarantee!
✅Commercial License included!
See My Other Reviews Article:
(1) AI Genie Review: https://sumonreview.com/ai-genie-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIFusionBuddyReview,
#AIFusionBuddyFeatures,
#AIFusionBuddyPricing,
#AIFusionBuddyProsandCons,
#AIFusionBuddyTutorial,
#AIFusionBuddyUserExperience
#AIFusionBuddyforBeginners,
#AIFusionBuddyBenefits,
#AIFusionBuddyComparison,
#AIFusionBuddyInstallation,
#AIFusionBuddyRefundPolicy,
#AIFusionBuddyDemo,
#AIFusionBuddyMaintenanceFees,
#AIFusionBuddyNewbieFriendly,
#WhatIsAIFusionBuddy?,
#HowDoesAIFusionBuddyWorks
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...kalichargn70th171
A dynamic process unfolds in the intricate realm of software development, dedicated to crafting and sustaining products that effortlessly address user needs. Amidst vital stages like market analysis and requirement assessments, the heart of software development lies in the meticulous creation and upkeep of source code. Code alterations are inherent, challenging code quality, particularly under stringent deadlines.
Utilocate offers a comprehensive solution for locate ticket management by automating and streamlining the entire process. By integrating with Geospatial Information Systems (GIS), it provides accurate mapping and visualization of utility locations, enhancing decision-making and reducing the risk of errors. The system's advanced data analytics tools help identify trends, predict potential issues, and optimize resource allocation, making the locate ticket management process smarter and more efficient. Additionally, automated ticket management ensures consistency and reduces human error, while real-time notifications keep all relevant personnel informed and ready to respond promptly.
The system's ability to streamline workflows and automate ticket routing significantly reduces the time taken to process each ticket, making the process faster and more efficient. Mobile access allows field technicians to update ticket information on the go, ensuring that the latest information is always available and accelerating the locate process. Overall, Utilocate not only enhances the efficiency and accuracy of locate ticket management but also improves safety by minimizing the risk of utility damage through precise and timely locates.
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j
Dr. Jesús Barrasa, Head of Solutions Architecture for EMEA, Neo4j
Découvrez les dernières innovations de Neo4j, et notamment les dernières intégrations cloud et les améliorations produits qui font de Neo4j un choix essentiel pour les développeurs qui créent des applications avec des données interconnectées et de l’IA générative.
Mobile App Development Company In Noida | Drona InfotechDrona Infotech
Looking for a reliable mobile app development company in Noida? Look no further than Drona Infotech. We specialize in creating customized apps for your business needs.
Visit Us For : https://www.dronainfotech.com/mobile-application-development/
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Crescat
Crescat is industry-trusted event management software, built by event professionals for event professionals. Founded in 2017, we have three key products tailored for the live event industry.
Crescat Event for concert promoters and event agencies. Crescat Venue for music venues, conference centers, wedding venues, concert halls and more. And Crescat Festival for festivals, conferences and complex events.
With a wide range of popular features such as event scheduling, shift management, volunteer and crew coordination, artist booking and much more, Crescat is designed for customisation and ease-of-use.
Over 125,000 events have been planned in Crescat and with hundreds of customers of all shapes and sizes, from boutique event agencies through to international concert promoters, Crescat is rigged for success. What's more, we highly value feedback from our users and we are constantly improving our software with updates, new features and improvements.
If you plan events, run a venue or produce festivals and you're looking for ways to make your life easier, then we have a solution for you. Try our software for free or schedule a no-obligation demo with one of our product specialists today at crescat.io
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
Enterprise Resource Planning System includes various modules that reduce any business's workload. Additionally, it organizes the workflows, which drives towards enhancing productivity. Here are a detailed explanation of the ERP modules. Going through the points will help you understand how the software is changing the work dynamics.
To know more details here: https://blogs.nyggs.com/nyggs/enterprise-resource-planning-erp-system-modules/
WhatsApp offers simple, reliable, and private messaging and calling services for free worldwide. With end-to-end encryption, your personal messages and calls are secure, ensuring only you and the recipient can access them. Enjoy voice and video calls to stay connected with loved ones or colleagues. Express yourself using stickers, GIFs, or by sharing moments on Status. WhatsApp Business enables global customer outreach, facilitating sales growth and relationship building through showcasing products and services. Stay connected effortlessly with group chats for planning outings with friends or staying updated on family conversations.
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsPeter Muessig
The UI5 tooling is the development and build tooling of UI5. It is built in a modular and extensible way so that it can be easily extended by your needs. This session will showcase various tooling extensions which can boost your development experience by far so that you can really work offline, transpile your code in your project to use even newer versions of EcmaScript (than 2022 which is supported right now by the UI5 tooling), consume any npm package of your choice in your project, using different kind of proxies, and even stitching UI5 projects during development together to mimic your target environment.
Software Engineering, Software Consulting, Tech Lead, Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Transaction, Spring MVC, OpenShift Cloud Platform, Kafka, REST, SOAP, LLD & HLD.
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
Flutter is a popular open source, cross-platform framework developed by Google. In this webinar we'll explore Flutter and its architecture, delve into the Flutter Embedder and Flutter’s Dart language, discover how to leverage Flutter for embedded device development, learn about Automotive Grade Linux (AGL) and its consortium and understand the rationale behind AGL's choice of Flutter for next-gen IVI systems. Don’t miss this opportunity to discover whether Flutter is right for your project.
1. Missing points from last presentation
• Which modifications done
• Detailed configuration options
• Change realtime support run time or statically?
• Statically, you need to compile the realtime patched kernel with CONFIG_PREEMPT_RT_FULL=y to support realtime.
• Linux kernel API documents
• https://www.kernel.org/doc/htmldocs/kernel-api/
• Operating system design
• Scheduling
• Other approaches to Linux realtime
• Xenomai
• RTLinux
• RTAI
• extra: does other mobile operating systems provide realtime capability?
• android os
• firefox os
1
• will be covered later
3. When does real-time Linux come into
embedded development?
• Hard real time requirements
• missing a deadline is a total system failure.
• strict deadline
• to control something that will end up
killing people if something goes wrong.
• eg. nuclear systems, pacemakers, avionics
3
4. When does real-time Linux come into
embedded development?
• Soft real time requirements
• maximizing the number of deadlines met,
• minimizing the lateness of tasks and
• maximizing the number of high priority tasks meeting their deadlines.
• violation of constraints results in degraded quality, but the system can
continue to operate.
• eg. Live audio-video systems
4
5. When does real-time Linux come into
embedded development?
• Firm real time requirements
• infrequent deadline misses are tolerable
• usefulness of a result is zero after its deadline
• eg. forecast systems
5
6. Preempt_rt: Hard real time
• "Hard" real-time software
• for robotics, stock exchanges (imkb)...
• has been used on computers that have gone into space.
6
7. Preempt_rt: Hard realtime
• faster response times
• removes all unbounded latencies
• linux kernel is filled with unbounded latencies
• non-deterministic behavior
• eg. unfair reader writer locks
• readers can continually take the lock
• bounded latency: eg. fair reader writer lock
• new readers will block if there's a writer waiting
7
8. Advantage over other rt linux
implementations
• preempt_rt makes linux itself real-time,
• others create a small ‘microkernel’ that runs like a hypervisor
• linux kernel runs as a task
• not really linux:
• rt tasks must be modified to communicate with ‘microkernel’
8
9. Main configuration
• No Preemption
• little scheduling overhead
• never schedule unless a function
explicitly calls schedule()
• eg. Servers
9
10. Main configuration
• Voluntary Preemption
• schedule only at “preemption points”
• reduce the maximum latency of rescheduling
• providing faster application reaction at the cost of slightly lower throughput.
• Implementation: might_sleep()
• calls might_resched();
• calls _cond_resched()
10
11. Main configuration
• Preemptible Kernel
• except within spin_locks and
• preempt_disable();
/* preemption is disabled */
preempt_enable();
• every spin_lock acts like a single “global lock” WRT preemption.
11
12. Main configuration
• Preemptible Kernel (Basic RT)
• to debug PREEMPT_RT_FULL
• to learn that problem is mutexes or not
• enables parts of the PREEMPT_RT options,
without sleeping spin_locks
• it will probably go away
12
13. • Fully Preemptible Kernel
• interrupts run as threads
• ability to modify the priorities of interrupts
• user space tasks can run at even a higher priority than interrupts.
• remove disabling of interrupts
• needed for kernel preemption
• conversion of spin_locks into mutexes
• spin_locks side effect
• disabling preemption
• priority inheritance for all locks
linux kernel
Main configuration
13
14. Sleeping spin_lock
• if task is blocked go to sleep
• mutexes
• threaded interrupts needed
• otherwise miss interrupt
• if not-threaded (not-prioritized) interrupt’s spin_locks’ changed to mutexes
• must not be in atomic paths
• preempt_disable()
• local_irq_save(flags): disable interrupt on the current processor and prior to
which it saves current interrupt state into flags.
14
15. raw_spin_lock
• creation of non-preemptible sections
• same as current mainline spin_locks
• should only be used for scheduler, rtmutex implementation,
debugging/tracing infrastructure and for timer interrupts
15
16. Non-Thread IRQs
• timer interrupt
• IRQF_TIMER flag
• flag for timer interrupts
• IRQF_NO_THREAD flag
• Explicitly marking interrupt as not be a thread
16
17. Threaded Interrupts
• driver wants handler as thread
• request_threaded_irq(irq, handler, thread_fn, irqflags, devname, dev_id)
• same as request_irq() with the addition of the thread_fn
• handler
• called in hard interrupt context
• check whether the interrupt originates from the device. If yes it needs to disable the interrupt on the
device and return IRQ_WAKE_THREAD
• IRQ_WAKE_THREAD will wake up the handler thread and run thread_fn
• if null, must have thread_fn
• threadirqs
• commandline parameter
• forces all interrupts to run threaded
• except IRQF_NO_THREAD
• mostly a debug option to allow retrieving better debug data from crashing interrupt
handlers.
17
18. Critical sections & disabling interrupts
• local_irq_disable()
• disables local interrupt delivery
• should not be used since:
• what it's protecting?
• spin_lock_irqsave(lock, flags)
• disables interrupts before taking the spinlock; the previous interrupt state is
stored in flags. If you are absolutely sure nothing else might have already
disabled interrupts, you can use spin_lock_irq instead
• preempt_rt does not disable interrupts
• should be used since:
• spin_lock_irqsave labeling what it’s protecting
18
19. Critical sections & disabling interrupts
• Avoid using
• local_irq_save()
• preempt_disable()
• get_cpu_var() since it calls preempt_disable() for per_cpu variables
• per_cpu variables can be manipulated without explicit locking
• rwlocks
• Writes must wait for unknown amount of readers
• Use
• get_cpu_light()
• local_lock[_irq[save]](var)
• get_local_var(var)
19
21. Understanding files
• https://www.kernel.org/pub/linux/kernel/projects/rt/
• patch-x.xx.xx-rty.patch
• x: linux kernel, y: patch. x-y pairs are one-to-one.
• patches-x.xx.xx-rty
• ~ 300 patches
• eg. ata-Do-not-disable-interrupts-in-ide-code-for-preemp.patch
• ide-Do-not-disable-interrupts-for-PREEMPT-RT.patch
• core-Do-not-disable-interrupts-on-RT-in-kernel-users.patch
• comments in code: Use the local_irq_*_nort variants to reduce latencies in RT. The codeis
serialized by the locks. No need to disable interrupts.
• ...
21