diff --git a/Documentation/implementation/critical_sections.rst b/Documentation/implementation/critical_sections.rst index 4939e153ba..80493250c4 100644 --- a/Documentation/implementation/critical_sections.rst +++ b/Documentation/implementation/critical_sections.rst @@ -23,7 +23,7 @@ When we discuss critical sections here we really refer to one of two mechanisms: The use of either mechanism will always harm real-time performance. The effects of critical sections on real-time performance is discussed in -`Effects of Disabling Interrupts or Pre-Emption on Response Latency `_ [TODO: move to documentation]. +:doc:`/implementation/preemption_latency`. The end result is that a certain amount of **jitter** is added to the real-time response. Critical sections cannot be avoided within the OS and, as a consequence, a certain diff --git a/Documentation/implementation/disabling_interrupts.png b/Documentation/implementation/disabling_interrupts.png new file mode 100644 index 0000000000..d28a8b0a78 Binary files /dev/null and b/Documentation/implementation/disabling_interrupts.png differ diff --git a/Documentation/implementation/disabling_preemption.png b/Documentation/implementation/disabling_preemption.png new file mode 100644 index 0000000000..ac6d2849d6 Binary files /dev/null and b/Documentation/implementation/disabling_preemption.png differ diff --git a/Documentation/implementation/index.rst b/Documentation/implementation/index.rst index 35442d724e..ba0be0b7a9 100644 --- a/Documentation/implementation/index.rst +++ b/Documentation/implementation/index.rst @@ -9,3 +9,4 @@ Implementation Details processes_vs_tasks.rst critical_sections.rst interrupt_controls.rst + preemption_latency.rst diff --git a/Documentation/implementation/normal_interrupt.png b/Documentation/implementation/normal_interrupt.png new file mode 100644 index 0000000000..1f1cc91c0f Binary files /dev/null and b/Documentation/implementation/normal_interrupt.png differ diff --git a/Documentation/implementation/preemption_latency.rst b/Documentation/implementation/preemption_latency.rst new file mode 100644 index 0000000000..629b6cb5e7 --- /dev/null +++ b/Documentation/implementation/preemption_latency.rst @@ -0,0 +1,41 @@ +================================================================== +Effects of Disabling Interrupts or Pre-Emption on Response Latency +================================================================== + +Rate Monotonic Scheduling +========================= + +**Assumption** + + No resource sharing (processes do not share resources, e.g. a hardware + resource, a queue, or any kind of semaphore blocking or non-blocking + (busy-waits)). + + Wikipedia “Rate Monotonic Scheduling” + +**Real world** + +We must protect shared resources with locks of some kind. The most aggressive: + +#. Disabling interrupts, and +#. Disabling pre-emption. + +What are the effects of real-time performance when this assumptions is violated? + +Normal Interrupt Processing +--------------------------- + +.. figure:: normal_interrupt.png + :align: center + +Effect of Disabling Interrupts +------------------------------ + +.. figure:: disabling_interrupts.png + :align: center + +Effect of Disabling Pre-emption +------------------------------- + +.. figure:: disabling_preemption.png + :align: center