• Bibo Mao's avatar
    LoongArch: Revert qspinlock to test-and-set simple lock on VM · e5ba90ab
    Bibo Mao authored
    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: default avatarBibo Mao <maobibo@loongson.cn>
    Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
    e5ba90ab
setup.c 14.8 KB