[bootlin/training-materials updates] master: Realtime: improve interrupt latency explanations (cfec6042)

Michael Opdenacker michael.opdenacker at bootlin.com
Mon Sep 28 13:56:37 CEST 2020


Repository : https://github.com/bootlin/training-materials
On branch  : master
Link       : https://github.com/bootlin/training-materials/commit/cfec604239f300ce72ee5b55b754317a02c8aa4e

>---------------------------------------------------------------

commit cfec604239f300ce72ee5b55b754317a02c8aa4e
Author: Michael Opdenacker <michael.opdenacker at bootlin.com>
Date:   Mon Sep 28 13:56:37 2020 +0200

    Realtime: improve interrupt latency explanations
    
    - Also a minor fix in one of the diagrams
    
    Signed-off-by: Michael Opdenacker <michael.opdenacker at bootlin.com>


>---------------------------------------------------------------

cfec604239f300ce72ee5b55b754317a02c8aa4e
 slides/sysdev-realtime/spinlock.dia        | 24 ++++++++++++------------
 slides/sysdev-realtime/sysdev-realtime.tex | 22 +++++++++++++++++++---
 2 files changed, 31 insertions(+), 15 deletions(-)

diff --git a/slides/sysdev-realtime/spinlock.dia b/slides/sysdev-realtime/spinlock.dia
index 0ddc5a1c..104e8d64 100644
--- a/slides/sysdev-realtime/spinlock.dia
+++ b/slides/sysdev-realtime/spinlock.dia
@@ -70,7 +70,7 @@
           <dia:boolean val="false"/>
         </dia:attribute>
         <dia:attribute name="snap-to-grid">
-          <dia:boolean val="false"/>
+          <dia:boolean val="true"/>
         </dia:attribute>
         <dia:attribute name="snap-to-object">
           <dia:boolean val="true"/>
@@ -303,16 +303,16 @@ disabled interrupts#</dia:string>
     </dia:object>
     <dia:object type="Standard - Box" version="0" id="O7">
       <dia:attribute name="obj_pos">
-        <dia:point val="23.8799,9"/>
+        <dia:point val="24,9"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="23.8299,8.95;29.025,11.05"/>
+        <dia:rectangle val="23.95,8.95;29.025,11.05"/>
       </dia:attribute>
       <dia:attribute name="elem_corner">
-        <dia:point val="23.8799,9"/>
+        <dia:point val="24,9"/>
       </dia:attribute>
       <dia:attribute name="elem_width">
-        <dia:real val="5.0951319479625639"/>
+        <dia:real val="4.9750319479625631"/>
       </dia:attribute>
       <dia:attribute name="elem_height">
         <dia:real val="2"/>
@@ -332,10 +332,10 @@ disabled interrupts#</dia:string>
     </dia:object>
     <dia:object type="Standard - Text" version="1" id="O8">
       <dia:attribute name="obj_pos">
-        <dia:point val="26.4274,10"/>
+        <dia:point val="26.4875,10"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="25.4962,9.3109;27.3587,10.6891"/>
+        <dia:rectangle val="25.5563,9.3109;27.4188,10.6891"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
@@ -350,7 +350,7 @@ handler#</dia:string>
             <dia:real val="0.63499997556209564"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="26.4274,9.89713"/>
+            <dia:point val="26.4875,9.89713"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000ff"/>
@@ -426,14 +426,14 @@ handler#</dia:string>
     </dia:object>
     <dia:object type="Standard - Line" version="0" id="O11">
       <dia:attribute name="obj_pos">
-        <dia:point val="19,12.5"/>
+        <dia:point val="19,12.6"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="18.8993,12.0335;24.1007,13.004"/>
+        <dia:rectangle val="18.9,12.1264;24.1,13.0736"/>
       </dia:attribute>
       <dia:attribute name="conn_endpoints">
-        <dia:point val="19,12.5"/>
-        <dia:point val="24,12.5375"/>
+        <dia:point val="19,12.6"/>
+        <dia:point val="24,12.6"/>
       </dia:attribute>
       <dia:attribute name="numcp">
         <dia:int val="1"/>
diff --git a/slides/sysdev-realtime/sysdev-realtime.tex b/slides/sysdev-realtime/sysdev-realtime.tex
index 3a4dfb44..0a332656 100644
--- a/slides/sysdev-realtime/sysdev-realtime.tex
+++ b/slides/sysdev-realtime/sysdev-realtime.tex
@@ -118,8 +118,24 @@
 \end{frame}
 
 \begin{frame}
-  \frametitle{Sources of interrupt latency (1)}
-  Cause: disabled interrupts
+  \frametitle{Sources of interrupt latency}
+  There can be multiple causes delaying the execution of an interrupt
+  handler.
+  \begin{itemize}
+    \item Interrupts disabled by evil drivers. Such drivers may still
+	  exist but can be fixed.
+    \item Already running interrupt handlers. In Linux, there are
+	  no nested interrupts. Only once interrupt handler can run
+	  at the same time on a give CPU core. Therefore, your critical
+	  interrupt handler may wait for the completion of another,
+	  non-critical handler.
+    \item Sections of kernel code when disabling interrupts is
+          necessary, typically in some {\em spinlocks}.
+  \end{itemize}
+\end{frame}
+
+\begin{frame}
+  \frametitle{Disabling interrupts in spinlocks (1)}
   \begin{itemize}
   \item One of the concurrency prevention mechanism used in the kernel
     is the {\bf spinlock}
@@ -136,7 +152,7 @@
 \end{frame}
 
 \begin{frame}
-  \frametitle{Sources of interrupt latency (2)}
+  \frametitle{Disabling interrupts in spinlocks (2)}
   \begin{itemize}
   \item To avoid such issues, when there can be concurrency between regular kernel code
         and interrupt code, spinlocks are held with interrupts disabled.




More information about the training-materials-updates mailing list