History

compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING

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.

Masahiro Yamada committed 7 years ago

Commit 9012d011 parent efc344c4 files · +15 −19Browse files

Showing the changes to include/linux (1 of 4 files). Show all

Unified · Split

include/linux/compiler_types.h+1−2
@@ -140,8 +140,7 @@ struct ftrace_likely_data { · 139 unmodified lines
140140 * Do not use __always_inline here, since currently it expands to inline again
141141 * (which would break users of __always_inline).
142142 */
143−#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
144− !defined(CONFIG_OPTIMIZE_INLINING)
143+#if !defined(CONFIG_OPTIMIZE_INLINING)
145144 #define inline inline __attribute__((__always_inline__)) __gnu_inline \
146145 __maybe_unused notrace
147146 #else

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t