Amit: How new-lines affect the Linux kernel performance
Nadav Amit decided to dig into why some small kernel functions were notbeing inlined by GCC; the result is a detailedinvestigation into how these things can go wrong. "Ignoring theassembly shenanigans that this code uses, we can see that in practice itgenerates a single ud2 instruction. However, the compiler considers thiscode to be 'big' and consequently oftentimes does not inline functions thatuse WARN() or similar functions.The reason turns to be the newline characters (marked as '\n' above). Thekernel compiler, GCC, is unaware to the code size that will be generated bythe inline assembly. It therefore tries to estimate its size based onnewline characters and statement separators (';' on x86)."