* [dpdk-dev] [RFC] Virtual Machine Power Management
@ 2014-09-11 15:53 Carew, Alan
0 siblings, 0 replies; only message in thread
From: Carew, Alan @ 2014-09-11 15:53 UTC (permalink / raw)
I am currently working on a Power Management example application for a Virtual Machine environment running on qemu/KVM and would appreciate any feedback(with code to share shortly).
The basic idea is to provide librte_power functionality from within a VM to address the lack(for good reason) of MSRs to facilitate frequency changes from within a VM.
For those unfamiliar, librte_power affects frequency changes via the "acpi-cpufreq" userspace power governor, accessed via sysfs.
The VM implementation allows for DPDK applications to request frequency changes via the librte_power API, however requests are forwarded over a message bus to a host monitor daemon which manages frequency changes for any number of VMs, the daemon itself uses librte_power then to honour the VM requests.
VM: rte_power_freq_max ----> guest_channel_send_msg(pkt) ----> HOST
HOST: epoll_wait() ----> read(pkt) ----> validate_and_process_request() ----> get_pcpus_mask(vCPU) ----> power_manager_scale_core_max(pCPU_mask);
The architecture requires a number of components to achieve this:
A means of forwarding frequency change requests to the host. I am using Virtio-Serial, it gives us a secure channel that can be configured in a number of ways. Each lcore in the VM has exclusive access to a channel. Each channel is configured as a serial device on the VM and as an AF_UNIX socket on the host. Both endpoints support poll/select/epoll. More information on Virtio-Serial is here: http://fedoraproject.org/wiki/Features/VirtioSerial
For each lcore, a channel is opened in non-blocking mode and frequency changes are just packets send via "write" to the channel. The existing l3fwd-power application be reused. Each packet has format of command(Power), resource(core) and amount(min/max/up/down).
Epoll based monitor to manage channel requests: frequency changes(after conversion of vCPU to pCPU), VM shutdown and error events
For channel management, adding channels to host monitor, disabling/re-enabling VM requests to allow for manual core frequency management(via CLI) and inspecting vCPU to physical CPU pinning.
A wrapper around librte_power to enable frequency changes for a mask of cores, however running a virtual CPU on multiple physical CPUs is not ideal, but is supported. The sharing of a physical CPU with multiple VMs is not supported, while it can be attempted there is no coordination of requests from different VMs.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-09-11 15:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-11 15:53 [dpdk-dev] [RFC] Virtual Machine Power Management Carew, Alan
DPDK patches and discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
Example config snippet for mirrors.
Newsgroup available over NNTP:
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git