*** BLURB HERE ***
Guo Xuenan (3): Revert "compiler: remove CONFIG_OPTIMIZE_INLINING entirely" disable OPTIMIZE_INLINING by default make OPTIMIZE_INLINING config editable
arch/arm64/kvm/sys_regs.h | 5 +++++ arch/x86/configs/i386_defconfig | 1 + arch/x86/configs/x86_64_defconfig | 1 + .../pci/hive_isp_css_include/print_support.h | 4 ++++ include/linux/compiler_types.h | 9 ++++++++- kernel/configs/tiny.config | 1 + lib/Kconfig.debug | 13 +++++++++++++ 7 files changed, 33 insertions(+), 1 deletion(-)
From: Guo Xuenan guoxuenan@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8PGC4
--------------------------------
This reverts commit 889b3c1245de48ed0cacf7aebb25c489d3e4a3e9.
Signed-off-by: Guo Xuenan guoxuenan@huawei.com Reviewed-by: Jason Yan yanaijie@huawei.com
Signed-off-by: Chen Jun chenjun102@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com Signed-off-by: Yuntao Liu liuyuntao12@huawei.com --- arch/x86/configs/i386_defconfig | 1 + arch/x86/configs/x86_64_defconfig | 1 + include/linux/compiler_types.h | 9 ++++++++- kernel/configs/tiny.config | 1 + lib/Kconfig.debug | 12 ++++++++++++ 5 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig index 1b411bbf3cb0..6a505b3b4b4d 100644 --- a/arch/x86/configs/i386_defconfig +++ b/arch/x86/configs/i386_defconfig @@ -280,5 +280,6 @@ CONFIG_BLK_DEV_IO_TRACE=y CONFIG_PROVIDE_OHCI1394_DMA_INIT=y CONFIG_EARLY_PRINTK_DBGP=y CONFIG_DEBUG_BOOT_PARAMS=y +CONFIG_OPTIMIZE_INLINING=y CONFIG_UNWINDER_FRAME_POINTER=y # CONFIG_64BIT is not set diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig index 409e9182bd29..5bd1fcabbe7d 100644 --- a/arch/x86/configs/x86_64_defconfig +++ b/arch/x86/configs/x86_64_defconfig @@ -276,3 +276,4 @@ CONFIG_BLK_DEV_IO_TRACE=y CONFIG_PROVIDE_OHCI1394_DMA_INIT=y CONFIG_EARLY_PRINTK_DBGP=y CONFIG_DEBUG_BOOT_PARAMS=y +CONFIG_OPTIMIZE_INLINING=y diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h index c523c6683789..ec15d8a5f115 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -206,14 +206,21 @@ struct ftrace_likely_data { #define __naked __attribute__((__naked__)) notrace
/* + * Force always-inline if the user requests it so via the .config. * Prefer gnu_inline, so that extern inline functions do not emit an * externally visible function. This makes extern inline behave as per gnu89 * semantics rather than c99. This prevents multiple symbol definition errors * of extern inline functions at link time. * A lot of inline functions can cause havoc with function tracing. + * Force always-inline if the user requests it so via the .config. + * (which would break users of __always_inline). */ +#if !defined(CONFIG_OPTIMIZE_INLINING) +#define inline inline __attribute__((__always_inline__)) __gnu_inline \ + __inline_maybe_unused notrace +#else #define inline inline __gnu_inline __inline_maybe_unused notrace - +#endif /* * gcc provides both __inline__ and __inline as alternate spellings of * the inline keyword, though the latter is undocumented. New kernel diff --git a/kernel/configs/tiny.config b/kernel/configs/tiny.config index 00009f7d0835..d0655ba4df4c 100644 --- a/kernel/configs/tiny.config +++ b/kernel/configs/tiny.config @@ -6,5 +6,6 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_KERNEL_XZ=y # CONFIG_KERNEL_LZO is not set # CONFIG_KERNEL_LZ4 is not set +CONFIG_OPTIMIZE_INLINING=y CONFIG_SLUB=y CONFIG_SLUB_TINY=y diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index cee4d3f75820..5a8d18f3be3b 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -474,6 +474,18 @@ config HEADERS_INSTALL user-space program samples. It is also needed by some features such as uapi header sanity checks.
+config OPTIMIZE_INLINING + def_bool y + help + This option determines if the kernel forces gcc to inline the functions + developers have marked 'inline'. Doing so takes away freedom from gcc to + do what it thinks is best, which is desirable for the gcc 3.x series of + compilers. The gcc 4.x series have a rewritten inlining algorithm and + enabling this option will generate a smaller kernel there. Hopefully + this algorithm is so good that allowing gcc 4.x and above to make the + decision will become the default in the future. Until then this option + is there to test gcc for this. + config DEBUG_SECTION_MISMATCH bool "Enable full Section mismatch analysis" depends on CC_IS_GCC
From: Guo Xuenan guoxuenan@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8PGC4
--------------------------------
for performance reasons, hulk 5.10 do not use OPTIMIZE_INLINING. it using gnu_inline attribute causing inline functions not really inline, which introducing performance issues,so we disable it and adapt some link conflicting functions.
Signed-off-by: Guo Xuenan guoxuenan@huawei.com Reviewed-by: Jason Yan yanaijie@huawei.com
Signed-off-by: Chen Jun chenjun102@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com Signed-off-by: Yuntao Liu liuyuntao12@huawei.com --- arch/arm64/kvm/sys_regs.h | 5 +++++ .../media/atomisp/pci/hive_isp_css_include/print_support.h | 4 ++++ lib/Kconfig.debug | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/sys_regs.h b/arch/arm64/kvm/sys_regs.h index c65c129b3500..9f88fc91b44c 100644 --- a/arch/arm64/kvm/sys_regs.h +++ b/arch/arm64/kvm/sys_regs.h @@ -100,8 +100,13 @@ struct sys_reg_desc { #define REG_USER_WI (1 << 3) /* WI from userspace only */
static __printf(2, 3) +#if defined(CONFIG_OPTIMIZE_INLINING) inline void print_sys_reg_msg(const struct sys_reg_params *p, char *fmt, ...) +#else +void print_sys_reg_msg(const struct sys_reg_params *p, + char *fmt, ...) +#endif { va_list va;
diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_include/print_support.h b/drivers/staging/media/atomisp/pci/hive_isp_css_include/print_support.h index a3c7f3de6d17..916529e10bd1 100644 --- a/drivers/staging/media/atomisp/pci/hive_isp_css_include/print_support.h +++ b/drivers/staging/media/atomisp/pci/hive_isp_css_include/print_support.h @@ -20,7 +20,11 @@
extern int (*sh_css_printf)(const char *fmt, va_list args); /* depends on host supplied print function in ia_css_init() */ +#if defined(CONFIG_OPTIMIZE_INLINING) static inline __printf(1, 2) void ia_css_print(const char *fmt, ...) +#else +static __printf(1, 2) void ia_css_print(const char *fmt, ...) +#endif { va_list ap;
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 5a8d18f3be3b..8c0b54eb9884 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -475,7 +475,7 @@ config HEADERS_INSTALL as uapi header sanity checks.
config OPTIMIZE_INLINING - def_bool y + def_bool n help This option determines if the kernel forces gcc to inline the functions developers have marked 'inline'. Doing so takes away freedom from gcc to
From: Guo Xuenan guoxuenan@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8PGC4
--------------------------------
in commit e2b3eb3c5 disable OPTIMIZE_INLINING by default, make it editable when using menuconfig
Signed-off-by: Guo Xuenan guoxuenan@huawei.com Reviewed-by: Jason Yan yanaijie@huawei.com Signed-off-by: Chen Jun chenjun102@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com Signed-off-by: Yuntao Liu liuyuntao12@huawei.com --- lib/Kconfig.debug | 1 + 1 file changed, 1 insertion(+)
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 8c0b54eb9884..0ec578b89961 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -475,6 +475,7 @@ config HEADERS_INSTALL as uapi header sanity checks.
config OPTIMIZE_INLINING + bool "Optimize inlining" def_bool n help This option determines if the kernel forces gcc to inline the functions
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/3467 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/3...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/3467 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/3...