[BL training-materials-updates] Kernel locking: add reference and summary

Michael Opdenacker michael.opdenacker at bootlin.com
Tue Dec 4 06:50:59 CET 2018

Repository : git://git.free-electrons.com/training-materials.git
On branch  : master
Link       : http://git.free-electrons.com/training-materials/commit/?id=e2ae44925b4126b29f2e362cf322f7b281868975


commit e2ae44925b4126b29f2e362cf322f7b281868975
Author: Michael Opdenacker <michael.opdenacker at bootlin.com>
Date:   Tue Dec 4 06:50:59 2018 +0100

    Kernel locking: add reference and summary
    Signed-off-by: Michael Opdenacker <michael.opdenacker at bootlin.com>


 .../kernel-driver-development-concurrency.tex             | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/slides/kernel-driver-development-concurrency/kernel-driver-development-concurrency.tex b/slides/kernel-driver-development-concurrency/kernel-driver-development-concurrency.tex
index a980597..426faa8 100644
--- a/slides/kernel-driver-development-concurrency/kernel-driver-development-concurrency.tex
+++ b/slides/kernel-driver-development-concurrency/kernel-driver-development-concurrency.tex
@@ -162,7 +162,8 @@
       and in a soft interrupt (\emph{bottom half}).
     \item No need to disable hardware interrupts in this case.
-  \item Note that reader / writer spinlocks also exist.
+  \item Note that reader / writer spinlocks also exist, allowing
+	for multiple simultaneous readers.
@@ -318,3 +319,15 @@ static unsigned int ulite_tx_empty
+  \frametitle{Kernel locking: summary and references}
+  \begin{itemize}
+  \item Use mutexes in code that is allowed to sleep
+  \item Use spinlocks in code that is not allowed to sleep (interrupts)
+    or for which sleeping would be too costly (critical sections)
+  \item Use atomic operations to protect integers or addresses
+  \end{itemize}
+  See \kerneldochtml{kernel-hacking/locking} in kernel documentation
+  for many details about kernel locking mechanisms.

More information about the training-materials-updates mailing list