All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm-devel <kvm@vger.kernel.org>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Andrea Arcangeli" <aarcange@redhat.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Wanpeng Li" <kernellwp@gmail.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"Raslan, KarimAllah" <karahmed@amazon.de>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
	"Ankur Arora" <ankur.a.arora@oracle.com>
Subject: Re: [PATCH] x86: add cpuidle_kvm driver to allow guest side halt polling
Date: Wed, 22 May 2019 13:45:16 -0300	[thread overview]
Message-ID: <20190522164516.GG2317@amt.cnet> (raw)
In-Reply-To: <fa7a52af-4cd4-9c60-7a16-138bd0a14de0@redhat.com>

On Wed, May 22, 2019 at 05:44:34PM +0200, Paolo Bonzini wrote:
> On 22/05/19 17:04, Marcelo Tosatti wrote:
> > Consider sequence of wakeup events as follows:
> > 20us, 200us, 20us, 200us...
> 
> I agree it can happen, which is why the grow/shrink behavior can be
> disabled for halt_poll_ns.  Is there a real-world usecase with a
> sequence like this?

If you have a database with variable response times in the
20,200,20,200... range, then yes.

Its not a bizzarre/unlikely sequence.

You didnt answer my question at the end of the email.

> The main qualm I have with guest-side polling is that it encourages the
> guest admin to be "impolite".  But I guess it was possible even now to
> boot guests with idle=poll, which would be way more impolite...

Yep.

Thanks.

> Paolo
> 
> > If one enables guest halt polling in the first place,
> > then the energy/performance tradeoff is bend towards
> > performance, and such misses are harmful.
> > 
> > So going to add something along the lines of:
> > 
> > "If, after 50 consecutive times, block_time is much larger than
> > halt_poll_ns, then set cpu->halt_poll_ns to zero".
> > 
> > Restore user halt_poll_ns value once one smaller block_time
> > is observed.
> > 
> > This should cover the full idle case, and cause minimal
> > harm to performance.
> > 
> > Is that OK or is there any other characteristic of
> > adaptive halt poll you are looking for?

      reply	other threads:[~2019-05-22 17:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17 17:48 [PATCH] x86: add cpuidle_kvm driver to allow guest side halt polling Marcelo Tosatti
2019-05-20 11:51 ` Paolo Bonzini
2019-05-20 12:07   ` Christian Borntraeger
2019-05-20 12:49     ` Marcelo Tosatti
2019-05-20 13:46     ` Christian Borntraeger
2019-05-22 15:07       ` Marcelo Tosatti
2019-05-20 12:49   ` Marcelo Tosatti
2019-05-22 15:04   ` Marcelo Tosatti
2019-05-22 15:44     ` Paolo Bonzini
2019-05-22 16:45       ` Marcelo Tosatti [this message]

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=20190522164516.GG2317@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=ankur.a.arora@oracle.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=karahmed@amazon.de \
    --cc=kernellwp@gmail.com \
    --cc=konrad.wilk@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rafael.j.wysocki@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.