hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I9IRPK
---------------------------
For arm64 physical machine, vcpu_is_preempted() is also redundant, disable vcpu_has_preemption static key if PV sched can't be used to reduce cache-misses influence.
Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- arch/arm64/kernel/paravirt.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/arch/arm64/kernel/paravirt.c b/arch/arm64/kernel/paravirt.c index 53bb6fa76366..e66dd05a849d 100644 --- a/arch/arm64/kernel/paravirt.c +++ b/arch/arm64/kernel/paravirt.c @@ -259,6 +259,8 @@ static bool has_kvm_pvsched(void) return (res.a0 == SMCCC_RET_SUCCESS); }
+DECLARE_STATIC_KEY_TRUE(vcpu_has_preemption); + int __init pv_sched_init(void) { int ret; @@ -276,6 +278,7 @@ int __init pv_sched_init(void) return ret;
static_call_update(pv_vcpu_preempted, kvm_vcpu_is_preempted); + static_branch_disable(&vcpu_has_preemption); pr_info("using PV sched preempted\n");
return 0;