From 453363333048f0b089adccb6aa677c2713c4e1ba Mon Sep 17 00:00:00 2001 From: Michael Opdenacker Date: Thu, 24 Jun 2021 09:31:42 +0200 Subject: [PATCH] Boot time slides: update CONFIG_CC_OPTIMIZE_FOR_SIZE results Signed-off-by: Michael Opdenacker --- slides/boot-time-kernel/boot-time-kernel.tex | 33 +++++++------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/slides/boot-time-kernel/boot-time-kernel.tex b/slides/boot-time-kernel/boot-time-kernel.tex index 1d0748b39..a90b5b108 100644 --- a/slides/boot-time-kernel/boot-time-kernel.tex +++ b/slides/boot-time-kernel/boot-time-kernel.tex @@ -152,37 +152,26 @@ \section{Kernel optimizations} \begin{itemize} \item \kconfig{CONFIG_CC_OPTIMIZE_FOR_SIZE}: possibility to compile the kernel with \code{gcc -Os} instead of \code{gcc -O2}. -\item Such optimizations give priority to code size at - the expense of code speed. -\item Results: the initial boot time is better (smaller - size), but the slower kernel code can offset - the benefits. Your system will run a bit slower! +\item Such optimizations give priority to code size at the expense of code speed. + \code{-Os} enables all \code{-O2} optimizations except those that + often increase code size. +\item Results: loading and decompressing the kernel is faster (smaller + size), but then the kernel boots and runs slower. \end{itemize} \end{frame} \begin{frame} \frametitle{Optimize kernel for size (2)} -Results on BeagleBone Black, Linux 5.1, lzo compression +Results on BeagleBone Black, Linux 5.11, lzo compression \begin{tabular}{| l || c | c | c |} \hline & O2 & Os & Diff \\ \hline -Size & 2533872 & 2390608 & -5.7 \% \\ -Copy time & 0.161 s & 0.153 s & -8 ms \\ -Starting kernel & 0.912 s & 0.904 s & -8 ms \\ -Starting userspace & 1.363 s & 1.359 s & -4 ms \\ -Total boot time & 2.961 s & 2.957s & -4 ms \\ -\hline -\end{tabular} -\newline\newline -Results on Microchip SAMA5D3 Xplained, Linux 3.10, gzip compression: -\begin{tabular}{| l || c | c | c |} -\hline -Timestamp & O2 & Os & Diff \\ -\hline -Starting kernel & 4.307 s & 4.213 s & -94 ms \\ -Starting init & 5.593 s & 5.549 s & -44 ms \\ -Login prompt & 21.085 s & 22.900 s & + 1.815 s \\ +Size & 2533872 & 6594440 & \% \\ +Copy time & 0.489 s & 0.437s s & -8 ms \\ +Decompression time & 1.490 s & 1.558 s & -68 ms \\ +Time to userspace & 1.303 s & 1.462 s & +159 ms \\ +Total boot time & 5.739 s & 5.796s & +57 ms \\ \hline \end{tabular} \newline\newline