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 Signed-off-by: liwei liwei728@huawei.com --- arch/arm64/kernel/paravirt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/paravirt.c b/arch/arm64/kernel/paravirt.c index 53bb6fa76366..7fb6833e1258 100644 --- a/arch/arm64/kernel/paravirt.c +++ b/arch/arm64/kernel/paravirt.c @@ -259,14 +259,19 @@ 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;
- if (is_hyp_mode_available()) + if (is_hyp_mode_available()) { + static_branch_disable(&vcpu_has_preemption); return 0; + }
if (!has_kvm_pvsched()) { + static_branch_disable(&vcpu_has_preemption); pr_warn("PV sched is not available\n"); return 0; }