aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/book3s_hv.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2015-07-16 03:11:14 -0400
committerAlexander Graf <agraf@suse.de>2015-08-22 05:16:19 -0400
commit563a1e93afac4d2c135072461fbab418b9dff43f (patch)
treec63509f4a46f0b512c4defd9f460751ed510e04b /arch/powerpc/kvm/book3s_hv.c
parent402813fe39db66e8f3be2a1b5b62dd664e33f6b8 (diff)
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: Paul Mackerras <paulus@samba.org> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm/book3s_hv.c')
-rw-r--r--arch/powerpc/kvm/book3s_hv.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 3d022766294a..fad52f226c12 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -2283,9 +2283,14 @@ static void post_guest_process(struct kvmppc_vcore *vc, bool is_master)
2283 } 2283 }
2284 list_del_init(&vc->preempt_list); 2284 list_del_init(&vc->preempt_list);
2285 if (!is_master) { 2285 if (!is_master) {
2286 vc->vcore_state = vc->runner ? VCORE_PREEMPT : VCORE_INACTIVE; 2286 if (still_running > 0) {
2287 if (still_running > 0)
2288 kvmppc_vcore_preempt(vc); 2287 kvmppc_vcore_preempt(vc);
2288 } else if (vc->runner) {
2289 vc->vcore_state = VCORE_PREEMPT;
2290 kvmppc_core_start_stolen(vc);
2291 } else {
2292 vc->vcore_state = VCORE_INACTIVE;
2293 }
2289 if (vc->n_runnable > 0 && vc->runner == NULL) { 2294 if (vc->n_runnable > 0 && vc->runner == NULL) {
2290 /* make sure there's a candidate runner awake */ 2295 /* make sure there's a candidate runner awake */
2291 vcpu = list_first_entry(&vc->runnable_threads, 2296 vcpu = list_first_entry(&vc->runnable_threads,