public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Wanpeng Li <kernellwp@gmail.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>, KVM <kvm@vger.kernel.org>,
	"Cornelia Huck" <cornelia.huck@de.ibm.com>,
	linux-s390 <linux-s390@vger.kernel.org>,
	"Jens Freimann" <jfrei@linux.vnet.ibm.com>,
	"David Hildenbrand" <dahi@linux.vnet.ibm.com>
Subject: Re: [PATCH/RFC] KVM: halt_polling: provide a way to qualify wakeups during poll
Date: Tue, 3 May 2016 09:00:41 +0200	[thread overview]
Message-ID: <57284C99.6090307@de.ibm.com> (raw)
In-Reply-To: <CANRm+Cx6LXcr-PUYQZAV0TB13K-VW-=jwQF_ZM6F=COxQFoM0Q@mail.gmail.com>

On 05/03/2016 07:42 AM, Wanpeng Li wrote:
> 2016-05-02 18:42 GMT+08:00 Christian Borntraeger <borntraeger@de.ibm.com>:
> [...]
>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>> index 9102ae1..d63ea60 100644
>> --- a/virt/kvm/kvm_main.c
>> +++ b/virt/kvm/kvm_main.c
>> @@ -2008,7 +2008,8 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
>>                          * arrives.
>>                          */
>>                         if (kvm_vcpu_check_block(vcpu) < 0) {
>> -                               ++vcpu->stat.halt_successful_poll;
>> +                               if (vcpu_valid_wakeup(vcpu))
>> +                                       ++vcpu->stat.halt_successful_poll;
>>                                 goto out;
>>                         }
>>                         cur = ktime_get();
>> @@ -2038,14 +2039,16 @@ out:
>>                 if (block_ns <= vcpu->halt_poll_ns)
>>                         ;
>>                 /* we had a long block, shrink polling */
>> -               else if (vcpu->halt_poll_ns && block_ns > halt_poll_ns)
>> +               else if (!vcpu_valid_wakeup(vcpu) ||
>> +                       (vcpu->halt_poll_ns && block_ns > halt_poll_ns))
>>                         shrink_halt_poll_ns(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)
>> +                       block_ns < halt_poll_ns && vcpu_valid_wakeup(vcpu))
>>                         grow_halt_poll_ns(vcpu);
>>         } else
>>                 vcpu->halt_poll_ns = 0;
>> +       vcpu_reset_wakeup(vcpu);
> 
> Why mark the next wakeup as a non-sucessful poll?

It is basically only used for s390 and used as a mean to implement the "default off,
only on for selected cases". But yes, if somebody else wants to use it this might 
need to be changed.
So what about changing this into
kvm_arch_vcpu_block_finish(vcpu)
which is a reset on s390 and a no for others?

Christian


  reply	other threads:[~2016-05-03  7:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-02 10:42 [PATCH/RFC] KVM: halt_polling: provide a way to qualify wakeups during poll Christian Borntraeger
2016-05-02 10:45 ` David Hildenbrand
2016-05-02 11:46 ` Cornelia Huck
2016-05-02 11:50   ` Christian Borntraeger
2016-05-02 13:34 ` Radim Krčmář
2016-05-02 14:30   ` Christian Borntraeger
2016-05-02 15:25     ` Radim Krčmář
2016-05-03  8:55       ` Christian Borntraeger
2016-05-02 19:44 ` David Matlack
2016-05-03  8:46   ` Christian Borntraeger
2016-05-03  5:42 ` Wanpeng Li
2016-05-03  7:00   ` Christian Borntraeger [this message]
2016-05-03  9:19     ` Cornelia Huck
2016-05-10 13:54     ` Paolo Bonzini
2016-05-03  7:50 ` Wanpeng Li
2016-05-03  8:00   ` Cornelia Huck
2016-05-03  8:00   ` Christian Borntraeger
2016-05-03  8:48     ` David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57284C99.6090307@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=dahi@linux.vnet.ibm.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox