From: qinyu qinyu16@huawei.com
euleros inclusion category: bugfix bugzilla: NA
--------------------------------
After we turned on CONFIG_ARMV8_DEPRECATE, we found hackbench test performance regressed:
for i in 20;do echo "--------pipe process num=$i----------" for j in $(seq 1 10000000);do ./hackbench -pipe $i process 1000 done done
here is the result: --------pipe process num=20---------- Running with 20*40 (== 800) tasks. Time: 1.739 Running with 20*40 (== 800) tasks. Time: 1.985 Running with 20*40 (== 800) tasks. Time: 1.088 Running with 20*40 (== 800) tasks. Time: 1.721 Running with 20*40 (== 800) tasks. Time: 1.455
the base line is: --------pipe process num=20---------- Running with 20*40 (== 800) tasks. Time: 0.272 Running with 20*40 (== 800) tasks. Time: 0.270 Running with 20*40 (== 800) tasks. Time: 0.303 Running with 20*40 (== 800) tasks. Time: 0.321 Running with 20*40 (== 800) tasks. Time: 0.304 Running with 20*40 (== 800) tasks. Time: 0.324
the reason is that this file "./arch/arm64/kernel/armv8_deprecated.c" adds a global variable "static DEFINE_RAW_SPINLOCK(insn_emulation_lock);" (after CONFIG_ARMV8_DEPRECATE is enabled) and the variable is inserted into the ".bss" section and this will cause an inappropriate shift to the other variables after it which are no longer cacheline-aligned.
here is the layout arrangement: ffff0000814599d8 <arch_kgdb_ops>: ...
ffff000081459a28 <insn_emulation_lock>: <---------new inserted var ...
ffff000081459a30 <sea_info>: <--------- misaligned ...
so we add __cacheline_aligned to this newly-inserted variable and placed it into the ".data" section.
Signed-off-by: liqingqing liqingqing3@huawei.com Signed-off-by: qinyu qinyu16@huawei.com Reviewed-by: Hanjun Guo guohanjun@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- arch/arm64/kernel/armv8_deprecated.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/armv8_deprecated.c b/arch/arm64/kernel/armv8_deprecated.c index c14b3a508c8a..3a36901b9402 100644 --- a/arch/arm64/kernel/armv8_deprecated.c +++ b/arch/arm64/kernel/armv8_deprecated.c @@ -61,7 +61,7 @@ struct insn_emulation {
static LIST_HEAD(insn_emulation); static int nr_insn_emulated __initdata; -static DEFINE_RAW_SPINLOCK(insn_emulation_lock); +static __cacheline_aligned DEFINE_RAW_SPINLOCK(insn_emulation_lock);
static void register_emulation_hooks(struct insn_emulation_ops *ops) {