Talk:Kernel/Optimization
Before creating a discussion or leaving a comment, please read about using talk pages. To create a new discussion, click here. Comments on an existing discussion should be signed using
~~~~
:
A comment [[User:Larry|Larry]] 13:52, 13 May 2024 (UTC) : A reply [[User:Sally|Sally]] 12:48, 5 November 2024 (UTC) :: Your reply ~~~~
Examples
You have just added some examples for hardening the kernel. Maybe you want read more here User:Pietinger/Tutorials/Kernel_Hardening_with_KSPP
-- Pietinger 09:03, 07 March 2023 (UTC)
Wording Queries
This is a really good new submission and one I think many people will find helpful so thanks for creating it.
I do have two queries though:
Here you have suggested using -O3, I know from testing using it systemwide this is generally slower so I think if you know in the case of kernel this is better it would be wise to add some results to show what to accept.
2. Kernel/Optimization#Clang.2FLLVM
Could you clarify what the warning is for on this one as you can use a LLVM compiled system with a GCC compiled kernel with very few issues nowadays as I'm running gentoo-kernel-bin on my system which is setup in this way.
-- Immolo (talk) 16:19, 10 March 2023 (UTC)
- 1. You can see some results in Phoronix article. I might add my own benchmarks 2. What i meant is to not mix the binutils, for example make CC=gcc LD=ld.lld AR=llvm-ar will not work because LLVM's ar and ld is not compatible with GCC. -- Gso321 (talk) 17:25, 10 March 2023 (UTC)
Links to hardened sources
Maybe you are interested also in this one: https://docs.clip-os.org/clipos/kernel.html#configuration (Clip OS is based on Gentoo and made from the french secret service.) -- Pietinger 07:55, 18 April 2023 (UTC)
Compiling Kernel GCC PGO not work
See post -- Antonellocaroli (talk) 09:04, 19 August 2023 (UTC)
LLVM toolchain install step is overzelous
Installing sys-libs/llvm-libunwind or sys-libs/compiler-rt is not necessary for building the kernel with clang. The kernel has not special requirement on them, and to use them would require extra setup (the kernel wouldn't use them even after that). Including sys-libs/llvm-libunwind especially in the instructions just causes confusion as sys-libs/libunwind is going to block it most of the time for non-llvm profile users.
Really the bare minimum it could be is clang+lld as clang and lld are going to pull in llvm by themselves.
Mentioning sys-libs/compiler-rt-santitizers could been useful if the use of the sanitizers was expanded on though (shadow-call-stack and kcfi).
On a similar note its odd that https://docs.kernel.org/kbuild/llvm.html isn't linked in this page, especially in the references.