Skip to content

Commit 7be6ce7

Browse files
vaibhav92mpe
authored andcommitted
KVM: PPC: Book3S HV nestedv2: Cancel pending DEC exception
This reverts commit 180c6b0 ("KVM: PPC: Book3S HV nestedv2: Do not cancel pending decrementer exception") [1] which prevented canceling a pending HDEC exception for nestedv2 KVM guests. It was done to avoid overhead of a H_GUEST_GET_STATE hcall to read the 'DEC expiry TB' register which was higher compared to handling extra decrementer exceptions. However recent benchmarks indicate that overhead of not handling 'DECR' expiry for Nested KVM Guest(L2) is higher and results in much larger exits to Pseries Host(L1) as indicated by the Unixbench-arithoh bench[2] Metric | Current upstream | Revert [1] | Difference % ======================================================================== arithoh-count (10) | 3244831634 | 3403089673 | +04.88% kvm_hv:kvm_guest_exit | 513558 | 152441 | -70.32% probe:kvmppc_gsb_recv | 28060 | 28110 | +00.18% N=1 As indicated by the data above that reverting [1] results in substantial reduction in number of L2->L1 exits with only slight increase in number of H_GUEST_GET_STATE hcalls to read the value of 'DEC expiry TB'. This results in an overall ~4% improvement of arithoh[2] throughput. [1] commit 180c6b0 ("KVM: PPC: Book3S HV nestedv2: Do not cancel pending decrementer exception") [2] https://github.com/kdlucas/byte-unixbench/ Fixes: 180c6b0 ("KVM: PPC: Book3S HV nestedv2: Do not cancel pending decrementer exception") Signed-off-by: Vaibhav Jain <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
1 parent 39cd87c commit 7be6ce7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/kvm/book3s_hv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4857,7 +4857,7 @@ int kvmhv_run_single_vcpu(struct kvm_vcpu *vcpu, u64 time_limit,
48574857
* entering a nested guest in which case the decrementer is now owned
48584858
* by L2 and the L1 decrementer is provided in hdec_expires
48594859
*/
4860-
if (!kvmhv_is_nestedv2() && kvmppc_core_pending_dec(vcpu) &&
4860+
if (kvmppc_core_pending_dec(vcpu) &&
48614861
((tb < kvmppc_dec_expires_host_tb(vcpu)) ||
48624862
(trap == BOOK3S_INTERRUPT_SYSCALL &&
48634863
kvmppc_get_gpr(vcpu, 3) == H_ENTER_NESTED)))

0 commit comments

Comments
 (0)