]> www.infradead.org Git - users/jedix/linux-maple.git/commit
LoongArch: Revert qspinlock to test-and-set simple lock on VM
authorBibo Mao <maobibo@loongson.cn>
Wed, 11 Sep 2024 15:26:32 +0000 (23:26 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Wed, 11 Sep 2024 15:26:32 +0000 (23:26 +0800)
commite5ba90abb2ebdfd3c19481319b349d4885312bef
treeea9a2200b6e24b0d5cfdf70998e7a91ff0a96366
parentda3ea35007d0af457a0afc87e84fddaebc4e0b63
LoongArch: Revert qspinlock to test-and-set simple lock on VM

Similar with x86, when VM is detected, revert to a simple test-and-set
lock to avoid the horrors of queue preemption.

Tested on 3C5000 Dual-way machine with 32 cores and 2 numa nodes,
test case is kcbench on kernel mainline 6.10, the detailed command is
"kcbench --src /root/src/linux"

Performance on host machine
                      kernel compile time       performance impact
   Original           150.29 seconds
   With patch         150.19 seconds            almost no impact

Performance on virtual machine:
1. 1 VM with 32 vCPUs and 2 numa node, numa node pinned
                      kernel compile time       performance impact
   Original           170.87 seconds
   With patch         171.73 seconds            almost no impact

2. 2 VMs, each VM with 32 vCPUs and 2 numa node, numa node pinned
                      kernel compile time       performance impact
   Original           2362.04 seconds
   With patch         354.73  seconds            +565%

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/include/asm/Kbuild
arch/loongarch/include/asm/paravirt.h
arch/loongarch/include/asm/qspinlock.h [new file with mode: 0644]
arch/loongarch/kernel/paravirt.c
arch/loongarch/kernel/setup.c
arch/loongarch/kernel/smp.c