All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-pm@lists.linux-foundation.org,
	Radim Krcmar <rkrcmar@redhat.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: [patch 0/3] KVM CPU frequency change hypercalls (resend)
Date: Wed, 15 Mar 2017 15:30:00 -0300	[thread overview]
Message-ID: <20170315182957.GA7981@amt.cnet> (raw)
In-Reply-To: <bd9ef067-d8a8-04f5-b1e8-1360eb2264a2@redhat.com>

On Wed, Mar 15, 2017 at 09:23:10AM +0100, Paolo Bonzini wrote:
> 
> 
> On 15/03/2017 00:27, Marcelo Tosatti wrote:
> >> So, the question then is how to design the hypervisor so that these NFV
> >> virtual machines can play with cpufreq, but there are no adverse
> >> indefinite effects. 
> > Ok, we can modify the cpufreq cgroups patch, to, from the hypercalls
> > set the:
> > 
> > "The first three patches of this series introduces
> > capacity_{min,max} tracking
> > in the core scheduler, as an extension of the CPU controller."
> > 
> > capacity_min == capacity_max values (which forces the CPU to run
> > at that frequency, given there are no other tasks requesting
> > frequency information on that CPU).
> > 
> > This is good enough DPDK.
> 
> So this sounds like a plan?

Yes, trying that now...

> 
> >> One possibility is to have some kind of per-task
> >> cpufreq.  Another is to do everything in userspace with virtual ACPI
> >> P-states and the userspace governor in the VM.
> >
> > Virtual ACPI P-state, that is an option. But why not make it
> > in-kernel, the exit to userspace can be a significant
> > fraction of the total if the frequency change time is small (say, 10us
> > freq change and 5us for userspace exit).
> 
> The advantage of doing it in userspace is that the sysfs chmod is a
> clear way to say "this VM should have the privilege of setting cpufreq.
>  In effect, userspace's file descriptor for the sysfs files represents
> the capability to set cpufreq for the VM.  You can even pass the file
> descriptor with SCM_RIGHTS if you wish to do so.
> 
> But of course that's only needed if the frequency change is global per
> physical CPU. if the CPU controller gains the ability to do per-task
> frequency switching, that's even better for KVM.  Then the hypercalls
> are just fine and we can have a KVM-specific cpufreq controller.
> 
> Paolo

I see, thanks.

      reply	other threads:[~2017-03-17 21:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-01 15:04 [patch 0/3] KVM CPU frequency change hypercalls (resend) Marcelo Tosatti
2017-03-01 15:04 ` [patch 1/3] cpufreq: implement min/max/up/down functions Marcelo Tosatti
2017-03-01 15:04 ` [patch 2/3] KVM: x86: introduce ioctl to allow frequency hypercalls Marcelo Tosatti
2017-03-01 15:04 ` [patch 3/3] KVM: x86: frequency change hypercalls Marcelo Tosatti
2017-03-02 10:15 ` [patch 0/3] KVM CPU frequency change hypercalls (resend) Paolo Bonzini
2017-03-02 13:59   ` Marcelo Tosatti
2017-03-14 16:40     ` Paolo Bonzini
2017-03-14 23:27       ` Marcelo Tosatti
2017-03-15  8:23         ` Paolo Bonzini
2017-03-15 18:30           ` 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=20170315182957.GA7981@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=pbonzini@redhat.com \
    --cc=rafael@kernel.org \
    --cc=rkrcmar@redhat.com \
    --cc=viresh.kumar@linaro.org \
    /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.