[bootlin/training-materials updates] master: Boot time labs: add "loops per jiffy" technique (36b8e60c)

Michael Opdenacker michael.opdenacker at bootlin.com
Tue May 3 15:33:12 CEST 2022


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

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

commit 36b8e60ce238b4366d06d4d0a08dc8a6fb5d1831
Author: Michael Opdenacker <michael.opdenacker at bootlin.com>
Date:   Tue May 3 15:33:12 2022 +0200

    Boot time labs: add "loops per jiffy" technique
    
    Saving about 85 ms on BeagleBoneBlack
    
    Signed-off-by: Michael Opdenacker <michael.opdenacker at bootlin.com>


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

36b8e60ce238b4366d06d4d0a08dc8a6fb5d1831
 labs/boot-time-bootloader/boot-time-bootloader.tex | 2 +-
 labs/boot-time-kernel/boot-time-kernel.tex         | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/labs/boot-time-bootloader/boot-time-bootloader.tex b/labs/boot-time-bootloader/boot-time-bootloader.tex
index 2228f097..a4f9eacb 100644
--- a/labs/boot-time-bootloader/boot-time-bootloader.tex
+++ b/labs/boot-time-bootloader/boot-time-bootloader.tex
@@ -126,7 +126,7 @@ the kernel and DTB. At least this works with U-Boot for our board.
 \begin{verbatim}
 load mmc 0:1 ${loadaddr} uImage
 load mmc 0:1 ${fdtaddr} dtb
-setenv bootargs console=ttyS0,115200n8 rdinit=/playvideo
+setenv bootargs console=ttyS0,115200n8 rdinit=/playvideo lpj=4980736
 spl export fdt ${loadaddr} - ${fdtaddr}
 \end{verbatim}
 
diff --git a/labs/boot-time-kernel/boot-time-kernel.tex b/labs/boot-time-kernel/boot-time-kernel.tex
index 518e66d3..2935489f 100644
--- a/labs/boot-time-kernel/boot-time-kernel.tex
+++ b/labs/boot-time-kernel/boot-time-kernel.tex
@@ -107,6 +107,15 @@ on the timing of messages in the console, to detect what's taking most
 time in the kernel initialization. That's almost equivalent, but more
 manual.
 
+\section{Optimizing necessary functionality}
+
+Measure the boot time by keeping a few \code{grabserial} logs with
+the current kernel.
+
+Implement the {\em Preset loops per jiffy} optimization by
+finding the \code{lpj} value and adding it to the kernel command line.
+Measure the time savings.
+
 \section{Removing unnecessary functionality}
 
 It's time to start simplifying the kernel by remove drivers and features




More information about the training-materials-updates mailing list