Skip to content

Commit

Permalink
Boot time slides: update CONFIG_CC_OPTIMIZE_FOR_SIZE results
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
  • Loading branch information
michaelopdenacker authored and tpetazzoni committed Oct 29, 2021
1 parent 2fbc323 commit 4533633
Showing 1 changed file with 11 additions and 22 deletions.
33 changes: 11 additions & 22 deletions slides/boot-time-kernel/boot-time-kernel.tex
Expand Up @@ -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
Expand Down

0 comments on commit 4533633

Please sign in to comment.