Re: [LKP] Re: [bpf] af7ec13833: will-it-scale.per_process_ops -2.5% regression

From: Feng Tang
Date: Mon Jul 13 2020 - 05:54:48 EST


On Fri, Jul 03, 2020 at 01:54:39PM +0800, Rong Chen wrote:
> > This commit should not cause regression.
> >
> > Probably the variation of performance is caused by test environment
> > which you may want to investigate further to reduce false alarming.
> > Thanks!
>
> Hi Yonghong,
>
> It's a function align issue, the commit effects the align of functions
> which causes a little regression,
> we force to set -falign-functions=32 in KBUILD_CFLAGS and the regression
> is gone:
>
> diff --git a/Makefile b/Makefile
> index 70def4907036c..9746afa4edc21 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -476,7 +476,7 @@ LINUXINCLUDEç? := \
> ççççççç? $(USERINCLUDE)
>
> çBUILD_AFLAGSç := -D__ASSEMBLY__ -fno-PIE
> -KBUILD_CFLAGSç := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
> +KBUILD_CFLAGSç := -Wall -Wundef -falign-functions=32
> -Werror=strict-prototypes -Wno-trigraphs \
> ççççççççç -fno-strict-aliasing -fno-common -fshort-wchar
> -fno-PIE \
> ççççççççç -Werror=implicit-function-declaration
> -Werror=implicit-int \
> ççççççççç -Wno-format-security \

For these strange performance change cases caused by a seemingly
unrelated commit, we have used this function alignment patch to
explain some of them to be caused by re-arrange of text code
alignment [1][2]

So one bold thought is can we merge this option into mainline under
a kernel config option in 'kernel hacking' category, with which both
developers and 0day can filter out some cases to be related with text
alignment change more easily?

[1] [LKP][mm] fd4d9c7d0c: stress-ng.switch.ops_per_sec -30.5% regression
https://lore.kernel.org/lkml/20200330011254.GA14393@feng-iot/
[2] [mm/hugetlb] c77c0a8ac4: will-it-scale.per_process_ops 15.9% improvement
https://lore.kernel.org/lkml/20200114085637.GA29297@shao2-debian/
(this patch is not used in the discussion, but we later used
this patch to confirm it's a text alignment case)

Thanks,
Feng