Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1643010

Re: [PATCH] KVM: x86: lower default for halt_poll_ns

From Paolo Bonzini <pbonzini@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] KVM: x86: lower default for halt_poll_ns
Date 2017-05-17 09:00 +0200
Message-ID <tI169-86C-3@gated-at.bofh.it> (permalink)
References <txyRP-57S-7@gated-at.bofh.it> <tHNZf-84e-3@gated-at.bofh.it> <tHRzQ-1XD-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> Still, I think we have dynamic polling to mitigate this overhead;
> how was it behaving?

Correctly: the polling stopped as soon as the benchmark ended. :)

> I noticed a questionable decision in growing the window:
> we know how long the polling should have been (block_ns), but we do not
> use that information to set the next halt_poll_ns.
> 
> Has something like this been tried?
> 
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index f0fe9d02f6bb..d8dbf50957fc 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -2193,7 +2193,7 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
>  		/* we had a short halt and our poll time is too small */
>  		else if (vcpu->halt_poll_ns < halt_poll_ns &&
>  			block_ns < halt_poll_ns)
> -			grow_halt_poll_ns(vcpu);
> +			vcpu->halt_poll_ns = block_ns /* + x ? */;

IIUC the idea was to grow slower than just, say, 10 ns -> 150 ns.
Taking into account block_ns might also be useful, but it shouldn't
matter much since the shrinking is very aggressive.

Paolo

>  	} else
>  		vcpu->halt_poll_ns = 0;
>  
> 
> It would avoid a case where several halts in a row were interrupted
> after 300 us, but on the first one we'd schedule out after 10 us, then
> after 20, 40, 80, 160, and finally have the successful poll at 320 us,
> but we have just wasted time if the window is reset at any point before
> that.
> 
> (I really don't like benchmarking ...)
> 
> Thanks.
> 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH] KVM: x86: lower default for halt_poll_ns Paolo Bonzini <pbonzini@redhat.com> - 2017-05-16 19:00 +0200
  Re: [PATCH] KVM: x86: lower default for halt_poll_ns Radim Krčmář <rkrcmar@redhat.com> - 2017-05-16 22:50 +0200
    Re: [PATCH] KVM: x86: lower default for halt_poll_ns Paolo Bonzini <pbonzini@redhat.com> - 2017-05-17 09:00 +0200

csiph-web