Commit 60a3cdd06394 ("x86: add optimized inlining") introduced CONFIG_OPTIMIZE_INLINING, but it has been available only for x86. The idea is obviously arch-agnostic. This commit moves the config entry from arch/x86/Kconfig.debug to lib/Kconfig.debug so that all architectures can benefit from it. This can make a huge difference in kernel image size especially when CONFIG_OPTIMIZE_FOR_SIZE is enabled. For example, I got 3.5% smaller arm64 kernel for v5.1-rc1. dec file 18983424 arch/arm64/boot/Image.before 18321920 arch/arm64/boot/Image.after This also slightly improves the "Kernel hacking" Kconfig menu as e61aca5158a8 ("Merge branch 'kconfig-diet' from Dave Hansen') suggested; this config option would be a good fit in the "compiler option" menu.
Showing the changes to include/linux (1 of 4 files). Show all
Unified · Split
| @@ -140,8 +140,7 @@ struct ftrace_likely_data { · 139 unmodified lines | ||
| 140 | 140 | * Do not use __always_inline here, since currently it expands to inline again |
| 141 | 141 | * (which would break users of __always_inline). |
| 142 | 142 | */ |
| 143 | −#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ | |
| 144 | − !defined(CONFIG_OPTIMIZE_INLINING) | |
| 143 | +#if !defined(CONFIG_OPTIMIZE_INLINING) | |
| 145 | 144 | #define inline inline __attribute__((__always_inline__)) __gnu_inline \ |
| 146 | 145 | __maybe_unused notrace |
| 147 | 146 | #else |