From: Guo Xuenan guoxuenan@huawei.com
hulk inclusion category: bugfix bugzilla: 182617 https://gitee.com/openeuler/kernel/issues/I4DDEL
--------------------------------
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 --- arch/arm64/kvm/sys_regs.h | 5 +++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 5 +++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h | 5 ++++- .../media/atomisp/pci/hive_isp_css_include/print_support.h | 4 ++++ lib/Kconfig.debug | 2 +- 5 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/kvm/sys_regs.h b/arch/arm64/kvm/sys_regs.h index 0f95964339b1..5f3d92b2568d 100644 --- a/arch/arm64/kvm/sys_regs.h +++ b/arch/arm64/kvm/sys_regs.h @@ -63,8 +63,13 @@ struct sys_reg_desc { #define REG_RAZ (1 << 1) /* RAZ from userspace and guest */
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/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c index 0e64c39a2372..a0b2e4f2d43f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c @@ -168,8 +168,13 @@ static uint32_t __calc_hdr_byte_sum(struct amdgpu_ras_eeprom_control *control) return tbl_sum; }
+#if defined(CONFIG_OPTIMIZE_INLINING) +static inline uint32_t __calc_recs_byte_sum(struct eeprom_table_record *records, + int num) +#else static uint32_t __calc_recs_byte_sum(struct eeprom_table_record *records, int num) +#endif { int i, j; uint32_t tbl_sum = 0; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h index c7a5e5c7c61e..d02019a2cbbb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h @@ -88,8 +88,11 @@ int amdgpu_ras_eeprom_process_recods(struct amdgpu_ras_eeprom_control *control, struct eeprom_table_record *records, bool write, int num); - +#if defined(CONFIG_OPTIMIZE_INLINING) inline uint32_t amdgpu_ras_eeprom_get_record_max_length(void); +#else +uint32_t amdgpu_ras_eeprom_get_record_max_length(void); +#endif
void amdgpu_ras_eeprom_test(struct amdgpu_ras_eeprom_control *control);
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 540b405cc0f7..6518eee7af83 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 ebd46c8d5fb8..a1a835c5d6cc 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -334,7 +334,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