All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 0/3] KVM CPU frequency change hypercalls
@ 2017-02-02 17:47 Marcelo Tosatti
  2017-02-02 17:47 ` [patch 1/3] cpufreq: implement min/max/up/down functions Marcelo Tosatti
                   ` (4 more replies)
  0 siblings, 5 replies; 29+ messages in thread
From: Marcelo Tosatti @ 2017-02-02 17:47 UTC (permalink / raw)
  To: kvm, linux-kernel
  Cc: Paolo Bonzini, Radim Krcmar, Rafael J. Wysocki, Viresh Kumar

Implement KVM hypercalls for the guest
to issue frequency changes.

Current situation with DPDK and frequency changes is as follows:
An algorithm in the guest decides when to increase/decrease
frequency based on the queue length of the device.

On the host, a power manager daemon is used to listen for
frequency change requests (on another core) and issue these
requests.

However frequency changes are performance sensitive events because:
On a change from low load condition to max load condition,
the frequency should be raised as soon as possible.
Sending a virtio-serial notification to another pCPU,
waiting for that pCPU to initiate an IPI to the requestor pCPU
to change frequency, is slower and more cache costly than
a direct hypercall to host to switch the frequency.

If the pCPU where the power manager daemon is running
is not busy spinning on requests from the isolated DPDK vcpus,
there is also the cost of HLT wakeup for that pCPU.

Moreover, the daemon serves multiple VMs, meaning that
the scheme is subject to additional delays from
queueing of power change requests from VMs.

A direct hypercall from userspace is the fastest most direct
method for the guest to change frequency and does not suffer
from the issues above.

The usage scenario for this hypercalls is for pinned vCPUs <-> pCPUs.

^ permalink raw reply	[flat|nested] 29+ messages in thread
* [patch 0/3] KVM CPU frequency change hypercalls (resend)
@ 2017-03-01 15:04 Marcelo Tosatti
  2017-03-01 15:04 ` [patch 3/3] KVM: x86: frequency change hypercalls Marcelo Tosatti
  0 siblings, 1 reply; 29+ messages in thread
From: Marcelo Tosatti @ 2017-03-01 15:04 UTC (permalink / raw)
  To: kvm, linux-pm
  Cc: Paolo Bonzini, Radim Krcmar, Rafael J. Wysocki, Viresh Kumar

NOTE: resending because of comments regarding that the cpufreq-userspace
scheme is bad design and something different should be done. 
The requirements that i've came up with are below.

Code comments of v1 are being addressed, not necessary to make
them again.

Paolo: please comment on your objections and what should
be done instead. Note the case "multiple vcpus 
on a given pcpu" is not part of the usecase in question.

===========================================================

Implement KVM hypercalls for the guest
to issue frequency changes.

Current situation with DPDK and frequency changes is as follows:
An algorithm in the guest decides when to increase/decrease
frequency based on the queue length of the device.

On the host, a power manager daemon is used to listen for
frequency change requests (on another core) and issue these
requests.

However frequency changes are performance sensitive events because:
On a change from low load condition to max load condition,
the frequency should be raised as soon as possible.
Sending a virtio-serial notification to another pCPU,
waiting for that pCPU to initiate an IPI to the requestor pCPU
to change frequency, is slower and more cache costly than
a direct hypercall to host to switch the frequency.

If the pCPU where the power manager daemon is running
is not busy spinning on requests from the isolated DPDK vcpus,
there is also the cost of HLT wakeup for that pCPU.

Moreover, the daemon serves multiple VMs, meaning that
the scheme is subject to additional delays from
queueing of power change requests from VMs.

A direct hypercall from userspace is the fastest most direct
method for the guest to change frequency and does not suffer
from the issues above.

The usage scenario for this hypercalls is for pinned vCPUs <-> pCPUs.

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2017-03-01 15:35 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-02 17:47 [patch 0/3] KVM CPU frequency change hypercalls Marcelo Tosatti
2017-02-02 17:47 ` [patch 1/3] cpufreq: implement min/max/up/down functions Marcelo Tosatti
2017-02-03  4:09   ` Viresh Kumar
2017-02-02 17:47 ` [patch 2/3] KVM: x86: introduce ioctl to allow frequency hypercalls Marcelo Tosatti
2017-02-03 17:03   ` Radim Krcmar
2017-02-22 21:18     ` Marcelo Tosatti
2017-02-23 16:48       ` Radim Krcmar
2017-02-23 17:31         ` Paolo Bonzini
2017-02-02 17:47 ` [patch 3/3] KVM: x86: frequency change hypercalls Marcelo Tosatti
2017-02-02 18:01   ` Marcelo Tosatti
2017-02-03 17:40   ` Radim Krcmar
2017-02-03 18:24     ` Marcelo Tosatti
2017-02-03 19:28       ` Radim Krcmar
2017-02-03 12:50 ` [patch 0/3] KVM CPU " Rafael J. Wysocki
2017-02-03 16:43 ` Radim Krcmar
2017-02-03 18:14   ` Marcelo Tosatti
2017-02-03 19:09     ` Radim Krcmar
2017-02-23 17:35       ` Paolo Bonzini
2017-02-23 23:19         ` Marcelo Tosatti
2017-02-24  9:18           ` Paolo Bonzini
2017-02-24 11:50             ` Marcelo Tosatti
2017-02-24 12:17               ` Paolo Bonzini
2017-02-24 13:04                 ` Marcelo Tosatti
2017-02-24 15:34                   ` Paolo Bonzini
2017-02-24 16:54                     ` Rafael J. Wysocki
2017-02-28  2:45                     ` Marcelo Tosatti
2017-03-01 14:21                       ` Paolo Bonzini
2017-03-01 15:11                         ` Marcelo Tosatti
2017-03-01 15:04 [patch 0/3] KVM CPU frequency change hypercalls (resend) Marcelo Tosatti
2017-03-01 15:04 ` [patch 3/3] KVM: x86: frequency change hypercalls Marcelo Tosatti

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.