提交 563a1e93 编写于 作者: P Paul Mackerras 提交者: Alexander Graf

KVM: PPC: Book3S HV: Fix preempted vcore stolen time calculation

Whenever a vcore state is VCORE_PREEMPT we need to be counting stolen
time for it.  This currently isn't the case when we have a vcore that
no longer has any runnable threads in it but still has a runner task,
so we do an explicit call to kvmppc_core_start_stolen() in that case.
Signed-off-by: NPaul Mackerras <paulus@samba.org>
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 402813fe
...@@ -2283,9 +2283,14 @@ static void post_guest_process(struct kvmppc_vcore *vc, bool is_master) ...@@ -2283,9 +2283,14 @@ static void post_guest_process(struct kvmppc_vcore *vc, bool is_master)
} }
list_del_init(&vc->preempt_list); list_del_init(&vc->preempt_list);
if (!is_master) { if (!is_master) {
vc->vcore_state = vc->runner ? VCORE_PREEMPT : VCORE_INACTIVE; if (still_running > 0) {
if (still_running > 0)
kvmppc_vcore_preempt(vc); kvmppc_vcore_preempt(vc);
} else if (vc->runner) {
vc->vcore_state = VCORE_PREEMPT;
kvmppc_core_start_stolen(vc);
} else {
vc->vcore_state = VCORE_INACTIVE;
}
if (vc->n_runnable > 0 && vc->runner == NULL) { if (vc->n_runnable > 0 && vc->runner == NULL) {
/* make sure there's a candidate runner awake */ /* make sure there's a candidate runner awake */
vcpu = list_first_entry(&vc->runnable_threads, vcpu = list_first_entry(&vc->runnable_threads,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册