New upstream version 18.11-rc1
[deb_dpdk.git] / doc / guides / sample_app_ug / vm_power_management.rst
1 ..  SPDX-License-Identifier: BSD-3-Clause
2     Copyright(c) 2010-2014 Intel Corporation.
3
4 VM Power Management Application
5 ===============================
6
7 Introduction
8 ------------
9
10 Applications running in Virtual Environments have an abstract view of
11 the underlying hardware on the Host, in particular applications cannot see
12 the binding of virtual to physical hardware.
13 When looking at CPU resourcing, the pinning of Virtual CPUs(vCPUs) to
14 Host Physical CPUs(pCPUS) is not apparent to an application
15 and this pinning may change over time.
16 Furthermore, Operating Systems on virtual machines do not have the ability
17 to govern their own power policy; the Machine Specific Registers (MSRs)
18 for enabling P-State transitions are not exposed to Operating Systems
19 running on Virtual Machines(VMs).
20
21 The Virtual Machine Power Management solution shows an example of
22 how a DPDK application can indicate its processing requirements using VM local
23 only information(vCPU/lcore, etc.) to a Host based Monitor which is responsible
24 for accepting requests for frequency changes for a vCPU, translating the vCPU
25 to a pCPU via libvirt and affecting the change in frequency.
26
27 The solution is comprised of two high-level components:
28
29 #. Example Host Application
30
31    Using a Command Line Interface(CLI) for VM->Host communication channel management
32    allows adding channels to the Monitor, setting and querying the vCPU to pCPU pinning,
33    inspecting and manually changing the frequency for each CPU.
34    The CLI runs on a single lcore while the thread responsible for managing
35    VM requests runs on a second lcore.
36
37    VM requests arriving on a channel for frequency changes are passed
38    to the librte_power ACPI cpufreq sysfs based library.
39    The Host Application relies on both qemu-kvm and libvirt to function.
40
41    This monitoring application is responsible for:
42
43    - Accepting requests from client applications: Client applications can
44      request frequency changes for a vCPU, translating
45      the vCPU to a pCPU via libvirt and affecting the change in frequency.
46
47    - Accepting policies from client applications: Client application can
48      send a policy to the host application. The
49      host application will then apply the rules of the policy independent
50      of the application. For example, the policy can contain time-of-day
51      information for busy/quiet periods, and the host application can scale
52      up/down the relevant cores when required. See the details of the guest
53      application below for more information on setting the policy values.
54
55    - Out-of-band monitoring of workloads via cores hardware event counters:
56      The host application can manage power for an application in a virtualised
57      OR non-virtualised environment by looking at the event counters of the
58      cores and taking action based on the branch hit/miss ratio. See the host
59      application '--core-list' command line parameter below.
60
61 #. librte_power for Virtual Machines
62
63    Using an alternate implementation for the librte_power API, requests for
64    frequency changes are forwarded to the host monitor rather than
65    the APCI cpufreq sysfs interface used on the host.
66
67    The l3fwd-power application will use this implementation when deployed on a VM
68    (see :doc:`l3_forward_power_man`).
69
70 .. _figure_vm_power_mgr_highlevel:
71
72 .. figure:: img/vm_power_mgr_highlevel.*
73
74    Highlevel Solution
75
76
77 Overview
78 --------
79
80 VM Power Management employs qemu-kvm to provide communications channels
81 between the host and VMs in the form of Virtio-Serial which appears as
82 a paravirtualized serial device on a VM and can be configured to use
83 various backends on the host. For this example each Virtio-Serial endpoint
84 on the host is configured as AF_UNIX file socket, supporting poll/select
85 and epoll for event notification.
86 In this example each channel endpoint on the host is monitored via
87 epoll for EPOLLIN events.
88 Each channel is specified as qemu-kvm arguments or as libvirt XML for each VM,
89 where each VM can have a number of channels up to a maximum of 64 per VM,
90 in this example each DPDK lcore on a VM has exclusive access to a channel.
91
92 To enable frequency changes from within a VM, a request via the librte_power interface
93 is forwarded via Virtio-Serial to the host, each request contains the vCPU
94 and power command(scale up/down/min/max).
95 The API for host and guest librte_power is consistent across environments,
96 with the selection of VM or Host Implementation determined at automatically
97 at runtime based on the environment.
98
99 Upon receiving a request, the host translates the vCPU to a pCPU via
100 the libvirt API before forwarding to the host librte_power.
101
102 .. _figure_vm_power_mgr_vm_request_seq:
103
104 .. figure:: img/vm_power_mgr_vm_request_seq.*
105
106    VM request to scale frequency
107
108
109 Performance Considerations
110 ~~~~~~~~~~~~~~~~~~~~~~~~~~
111
112 While Haswell Microarchitecture allows for independent power control for each core,
113 earlier Microarchtectures do not offer such fine grained control.
114 When deployed on pre-Haswell platforms greater care must be taken in selecting
115 which cores are assigned to a VM, for instance a core will not scale down
116 until its sibling is similarly scaled.
117
118 Configuration
119 -------------
120
121 BIOS
122 ~~~~
123
124 Enhanced Intel SpeedStepĀ® Technology must be enabled in the platform BIOS
125 if the power management feature of DPDK is to be used.
126 Otherwise, the sys file folder /sys/devices/system/cpu/cpu0/cpufreq will not exist,
127 and the CPU frequency-based power management cannot be used.
128 Consult the relevant BIOS documentation to determine how these settings
129 can be accessed.
130
131 Host Operating System
132 ~~~~~~~~~~~~~~~~~~~~~
133
134 The Host OS must also have the *apci_cpufreq* module installed, in some cases
135 the *intel_pstate* driver may be the default Power Management environment.
136 To enable *acpi_cpufreq* and disable *intel_pstate*, add the following
137 to the grub Linux command line:
138
139 .. code-block:: console
140
141   intel_pstate=disable
142
143 Upon rebooting, load the *acpi_cpufreq* module:
144
145 .. code-block:: console
146
147   modprobe acpi_cpufreq
148
149 Hypervisor Channel Configuration
150 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
151
152 Virtio-Serial channels are configured via libvirt XML:
153
154
155 .. code-block:: xml
156
157   <name>{vm_name}</name>
158   <controller type='virtio-serial' index='0'>
159     <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
160   </controller>
161   <channel type='unix'>
162     <source mode='bind' path='/tmp/powermonitor/{vm_name}.{channel_num}'/>
163     <target type='virtio' name='virtio.serial.port.poweragent.{vm_channel_num}'/>
164     <address type='virtio-serial' controller='0' bus='0' port='{N}'/>
165   </channel>
166
167
168 Where a single controller of type *virtio-serial* is created and up to 32 channels
169 can be associated with a single controller and multiple controllers can be specified.
170 The convention is to use the name of the VM in the host path *{vm_name}* and
171 to increment *{channel_num}* for each channel, likewise the port value *{N}*
172 must be incremented for each channel.
173
174 Each channel on the host will appear in *path*, the directory */tmp/powermonitor/*
175 must first be created and given qemu permissions
176
177 .. code-block:: console
178
179   mkdir /tmp/powermonitor/
180   chown qemu:qemu /tmp/powermonitor
181
182 Note that files and directories within /tmp are generally removed upon
183 rebooting the host and the above steps may need to be carried out after each reboot.
184
185 The serial device as it appears on a VM is configured with the *target* element attribute *name*
186 and must be in the form of *virtio.serial.port.poweragent.{vm_channel_num}*,
187 where *vm_channel_num* is typically the lcore channel to be used in DPDK VM applications.
188
189 Each channel on a VM will be present at */dev/virtio-ports/virtio.serial.port.poweragent.{vm_channel_num}*
190
191 Compiling and Running the Host Application
192 ------------------------------------------
193
194 Compiling
195 ~~~~~~~~~
196
197 For information on compiling DPDK and the sample applications
198 see :doc:`compiling`.
199
200 The application is located in the ``vm_power_manager`` sub-directory.
201
202 To build just the ``vm_power_manager`` application using ``make``:
203
204 .. code-block:: console
205
206   export RTE_SDK=/path/to/rte_sdk
207   export RTE_TARGET=build
208   cd ${RTE_SDK}/examples/vm_power_manager/
209   make
210
211 The resulting binary will be ${RTE_SDK}/build/examples/vm_power_manager
212
213 To build just the ``vm_power_manager`` application using ``meson/ninja``:
214
215 .. code-block:: console
216
217   export RTE_SDK=/path/to/rte_sdk
218   cd ${RTE_SDK}
219   meson build
220   cd build
221   ninja
222   meson configure -Dexamples=vm_power_manager
223   ninja
224
225 The resulting binary will be ${RTE_SDK}/build/examples/dpdk-vm_power_manager
226
227 Running
228 ~~~~~~~
229
230 The application does not have any specific command line options other than *EAL*:
231
232 .. code-block:: console
233
234  ./build/vm_power_mgr [EAL options]
235
236 The application requires exactly two cores to run, one core is dedicated to the CLI,
237 while the other is dedicated to the channel endpoint monitor, for example to run
238 on cores 0 & 1 on a system with 4 memory channels:
239
240 .. code-block:: console
241
242  ./build/vm_power_mgr -l 0-1 -n 4
243
244 After successful initialization the user is presented with VM Power Manager CLI:
245
246 .. code-block:: console
247
248   vm_power>
249
250 Virtual Machines can now be added to the VM Power Manager:
251
252 .. code-block:: console
253
254   vm_power> add_vm {vm_name}
255
256 When a {vm_name} is specified with the *add_vm* command a lookup is performed
257 with libvirt to ensure that the VM exists, {vm_name} is used as an unique identifier
258 to associate channels with a particular VM and for executing operations on a VM within the CLI.
259 VMs do not have to be running in order to add them.
260
261 A number of commands can be issued via the CLI in relation to VMs:
262
263   Remove a Virtual Machine identified by {vm_name} from the VM Power Manager.
264
265   .. code-block:: console
266
267     rm_vm {vm_name}
268
269   Add communication channels for the specified VM, the virtio channels must be enabled
270   in the VM configuration(qemu/libvirt) and the associated VM must be active.
271   {list} is a comma-separated list of channel numbers to add, using the keyword 'all'
272   will attempt to add all channels for the VM:
273
274   .. code-block:: console
275
276     add_channels {vm_name} {list}|all
277
278   Enable or disable the communication channels in {list}(comma-separated)
279   for the specified VM, alternatively list can be replaced with keyword 'all'.
280   Disabled channels will still receive packets on the host, however the commands
281   they specify will be ignored. Set status to 'enabled' to begin processing requests again:
282
283   .. code-block:: console
284
285     set_channel_status {vm_name} {list}|all enabled|disabled
286
287   Print to the CLI the information on the specified VM, the information
288   lists the number of vCPUS, the pinning to pCPU(s) as a bit mask, along with
289   any communication channels associated with each VM, along with the status of each channel:
290
291   .. code-block:: console
292
293     show_vm {vm_name}
294
295   Set the binding of Virtual CPU on VM with name {vm_name}  to the Physical CPU mask:
296
297   .. code-block:: console
298
299     set_pcpu_mask {vm_name} {vcpu} {pcpu}
300
301   Set the binding of Virtual CPU on VM to the Physical CPU:
302
303   .. code-block:: console
304
305     set_pcpu {vm_name} {vcpu} {pcpu}
306
307 Manual control and inspection can also be carried in relation CPU frequency scaling:
308
309   Get the current frequency for each core specified in the mask:
310
311   .. code-block:: console
312
313     show_cpu_freq_mask {mask}
314
315   Set the current frequency for the cores specified in {core_mask} by scaling each up/down/min/max:
316
317   .. code-block:: console
318
319     set_cpu_freq {core_mask} up|down|min|max
320
321   Get the current frequency for the specified core:
322
323   .. code-block:: console
324
325     show_cpu_freq {core_num}
326
327   Set the current frequency for the specified core by scaling up/down/min/max:
328
329   .. code-block:: console
330
331     set_cpu_freq {core_num} up|down|min|max
332
333 There are also some command line parameters for enabling the out-of-band
334 monitoring of branch ratio on cores doing busy polling via PMDs.
335
336   .. code-block:: console
337
338     --core-list {list of cores}
339
340   When this parameter is used, the list of cores specified will monitor the ratio
341   between branch hits and branch misses. A tightly polling PMD thread will have a
342   very low branch ratio, so the core frequency will be scaled down to the minimim
343   allowed value. When packets are received, the code path will alter, causing the
344   branch ratio to increase. When the ratio goes above the ratio threshold, the
345   core frequency will be scaled up to the maximum allowed value.
346
347   .. code-block:: console
348
349     --branch-ratio {ratio}
350
351   The branch ratio is a floating point number that specifies the threshold at which
352   to scale up or down for the given workload. The default branch ratio is 0.01,
353   and will need to be adjusted for different workloads.
354
355
356
357 JSON API
358 ~~~~~~~~
359
360 In addition to the command line interface for host command and a virtio-serial
361 interface for VM power policies, there is also a JSON interface through which
362 power commands and policies can be sent. This functionality adds a dependency
363 on the Jansson library, and the Jansson development package must be installed
364 on the system before the JSON parsing functionality is included in the app.
365 This is achieved by:
366
367   .. code-block:: javascript
368
369     apt-get install libjansson-dev
370
371 The command and package name may be different depending on your operating
372 system. It's worth noting that the app will successfully build without this
373 package present, but a warning is shown during compilation, and the JSON
374 parsing functionality will not be present in the app.
375
376 Sending a command or policy to the power manager application is achieved by
377 simply opening a fifo file, writing a JSON string to that fifo, and closing
378 the file.
379
380 The fifo is at /tmp/powermonitor/fifo
381
382 The jason string can be a policy or instruction, and takes the following
383 format:
384
385   .. code-block:: javascript
386
387     {"packet_type": {
388       "pair_1": value,
389       "pair_2": value
390     }}
391
392 The 'packet_type' header can contain one of two values, depending on
393 whether a policy or power command is being sent. The two possible values are
394 "policy" and "instruction", and the expected name-value pairs is different
395 depending on which type is being sent.
396
397 The pairs are the format of standard JSON name-value pairs. The value type
398 varies between the different name/value pairs, and may be integers, strings,
399 arrays, etc. Examples of policies follow later in this document. The allowed
400 names and value types are as follows:
401
402
403 :Pair Name: "name"
404 :Description: Name of the VM or Host. Allows the parser to associate the
405   policy with the relevant VM or Host OS.
406 :Type: string
407 :Values: any valid string
408 :Required: yes
409 :Example:
410
411     .. code-block:: javascript
412
413       "name", "ubuntu2"
414
415
416 :Pair Name: "command"
417 :Description: The type of packet we're sending to the power manager. We can be
418   creating or destroying a policy, or sending a direct command to adjust
419   the frequency of a core, similar to the command line interface.
420 :Type: string
421 :Values:
422
423   :CREATE: used when creating a new policy,
424   :DESTROY: used when removing a policy,
425   :POWER: used when sending an immediate command, max, min, etc.
426 :Required: yes
427 :Example:
428
429     .. code-block:: javascript
430
431       "command", "CREATE"
432
433
434 :Pair Name: "policy_type"
435 :Description: Type of policy to apply. Please see vm_power_manager documentation
436   for more information on the types of policies that may be used.
437 :Type: string
438 :Values:
439
440   :TIME: Time-of-day policy. Frequencies of the relevant cores are
441     scaled up/down depending on busy and quiet hours.
442   :TRAFFIC: This policy takes statistics from the NIC and scales up
443     and down accordingly.
444   :WORKLOAD: This policy looks at how heavily loaded the cores are,
445     and scales up and down accordingly.
446   :BRANCH_RATIO: This out-of-band policy can look at the ratio between
447     branch hits and misses on a core, and is useful for detecting
448     how much packet processing a core is doing.
449 :Required: only for CREATE/DESTROY command
450 :Example:
451
452   .. code-block:: javascript
453
454     "policy_type", "TIME"
455
456 :Pair Name: "busy_hours"
457 :Description: The hours of the day in which we scale up the cores for busy
458   times.
459 :Type: array of integers
460 :Values: array with list of hour numbers, (0-23)
461 :Required: only for TIME policy
462 :Example:
463
464   .. code-block:: javascript
465
466     "busy_hours":[ 17, 18, 19, 20, 21, 22, 23 ]
467
468 :Pair Name: "quiet_hours"
469 :Description: The hours of the day in which we scale down the cores for quiet
470   times.
471 :Type: array of integers
472 :Values: array with list of hour numbers, (0-23)
473 :Required: only for TIME policy
474 :Example:
475
476   .. code-block:: javascript
477
478     "quiet_hours":[ 2, 3, 4, 5, 6 ]
479
480 :Pair Name: "avg_packet_thresh"
481 :Description: Threshold below which the frequency will be set to min for
482   the TRAFFIC policy. If the traffic rate is above this and below max, the
483   frequency will be set to medium.
484 :Type: integer
485 :Values: The number of packets below which the TRAFFIC policy applies the
486   minimum frequency, or medium frequency if between avg and max thresholds.
487 :Required: only for TRAFFIC policy
488 :Example:
489
490   .. code-block:: javascript
491
492     "avg_packet_thresh": 100000
493
494 :Pair Name: "max_packet_thresh"
495 :Description: Threshold above which the frequency will be set to max for
496   the TRAFFIC policy
497 :Type: integer
498 :Values: The number of packets per interval above which the TRAFFIC policy
499   applies the maximum frequency
500 :Required: only for TRAFFIC policy
501 :Example:
502
503   .. code-block:: javascript
504
505     "max_packet_thresh": 500000
506
507 :Pair Name: "core_list"
508 :Description: The cores to which to apply the policy.
509 :Type: array of integers
510 :Values: array with list of virtual CPUs.
511 :Required: only policy CREATE/DESTROY
512 :Example:
513
514   .. code-block:: javascript
515
516     "core_list":[ 10, 11 ]
517
518 :Pair Name: "workload"
519 :Description: When our policy is of type WORKLOAD, we need to specify how
520   heavy our workload is.
521 :Type: string
522 :Values:
523
524   :HIGH: For cores running workloads that require high frequencies
525   :MEDIUM: For cores running workloads that require medium frequencies
526   :LOW: For cores running workloads that require low frequencies
527 :Required: only for WORKLOAD policy types
528 :Example:
529
530   .. code-block:: javascript
531
532     "workload", "MEDIUM"
533
534 :Pair Name: "mac_list"
535 :Description: When our policy is of type TRAFFIC, we need to specify the
536   MAC addresses that the host needs to monitor
537 :Type: string
538 :Values: array with a list of mac address strings.
539 :Required: only for TRAFFIC policy types
540 :Example:
541
542   .. code-block:: javascript
543
544     "mac_list":[ "de:ad:be:ef:01:01", "de:ad:be:ef:01:02" ]
545
546 :Pair Name: "unit"
547 :Description: the type of power operation to apply in the command
548 :Type: string
549 :Values:
550
551   :SCALE_MAX: Scale frequency of this core to maximum
552   :SCALE_MIN: Scale frequency of this core to minimum
553   :SCALE_UP: Scale up frequency of this core
554   :SCALE_DOWN: Scale down frequency of this core
555   :ENABLE_TURBO: Enable Turbo Boost for this core
556   :DISABLE_TURBO: Disable Turbo Boost for this core
557 :Required: only for POWER instruction
558 :Example:
559
560   .. code-block:: javascript
561
562     "unit", "SCALE_MAX"
563
564 :Pair Name: "resource_id"
565 :Description: The core to which to apply the power command.
566 :Type: integer
567 :Values: valid core id for VM or host OS.
568 :Required: only POWER instruction
569 :Example:
570
571   .. code-block:: javascript
572
573     "resource_id": 10
574
575 JSON API Examples
576 ~~~~~~~~~~~~~~~~~
577
578 Profile create example:
579
580   .. code-block:: javascript
581
582     {"policy": {
583       "name": "ubuntu",
584       "command": "create",
585       "policy_type": "TIME",
586       "busy_hours":[ 17, 18, 19, 20, 21, 22, 23 ],
587       "quiet_hours":[ 2, 3, 4, 5, 6 ],
588       "core_list":[ 11 ]
589     }}
590
591 Profile destroy example:
592
593   .. code-block:: javascript
594
595     {"profile": {
596       "name": "ubuntu",
597       "command": "destroy",
598     }}
599
600 Power command example:
601
602   .. code-block:: javascript
603
604     {"command": {
605       "name": "ubuntu",
606       "unit": "SCALE_MAX",
607       "resource_id": 10
608     }}
609
610 To send a JSON string to the Power Manager application, simply paste the
611 example JSON string into a text file and cat it into the fifo:
612
613   .. code-block:: console
614
615     cat file.json >/tmp/powermonitor/fifo
616
617 The console of the Power Manager application should indicate the command that
618 was just received via the fifo.
619
620 Compiling and Running the Guest Applications
621 --------------------------------------------
622
623 l3fwd-power is one sample application that can be used with vm_power_manager.
624
625 A guest CLI is also provided for validating the setup.
626
627 For both l3fwd-power and guest CLI, the channels for the VM must be monitored by the
628 host application using the *add_channels* command on the host. This typically uses
629 the following commands in the host application:
630
631 .. code-block:: console
632
633   vm_power> add_vm vmname
634   vm_power> add_channels vmname all
635   vm_power> set_channel_status vmname all enabled
636   vm_power> show_vm vmname
637
638
639 Compiling
640 ~~~~~~~~~
641
642 For information on compiling DPDK and the sample applications
643 see :doc:`compiling`.
644
645 For compiling and running l3fwd-power, see :doc:`l3_forward_power_man`.
646
647 The application is located in the ``guest_cli`` sub-directory under ``vm_power_manager``.
648
649 To build just the ``guest_vm_power_manager`` application using ``make``:
650
651 .. code-block:: console
652
653   export RTE_SDK=/path/to/rte_sdk
654   export RTE_TARGET=build
655   cd ${RTE_SDK}/examples/vm_power_manager/guest_cli/
656   make
657
658 The resulting binary will be ${RTE_SDK}/build/examples/guest_cli
659
660 To build just the ``vm_power_manager`` application using ``meson/ninja``:
661
662 .. code-block:: console
663
664   export RTE_SDK=/path/to/rte_sdk
665   cd ${RTE_SDK}
666   meson build
667   cd build
668   ninja
669   meson configure -Dexamples=vm_power_manager/guest_cli
670   ninja
671
672 The resulting binary will be ${RTE_SDK}/build/examples/guest_cli
673
674 Running
675 ~~~~~~~
676
677 The standard *EAL* command line parameters are required:
678
679 .. code-block:: console
680
681  ./build/guest_vm_power_mgr [EAL options] -- [guest options]
682
683 The guest example uses a channel for each lcore enabled. For example,
684 to run on cores 0,1,2,3:
685
686 .. code-block:: console
687
688  ./build/guest_vm_power_mgr -l 0-3
689
690 Optionally, there is a list of command line parameter should the user wish to send a power
691 policy down to the host application. These parameters are as follows:
692
693   .. code-block:: console
694
695     --vm-name {name of guest vm}
696
697   This parameter allows the user to change the Virtual Machine name passed down to the
698   host application via the power policy. The default is "ubuntu2"
699
700   .. code-block:: console
701
702     --vcpu-list {list vm cores}
703
704   A comma-separated list of cores in the VM that the user wants the host application to
705   monitor. The list of cores in any vm starts at zero, and these are mapped to the
706   physical cores by the host application once the policy is passed down.
707   Valid syntax includes individial cores '2,3,4', or a range of cores '2-4', or a
708   combination of both '1,3,5-7'
709
710   .. code-block:: console
711
712     --busy-hours {list of busy hours}
713
714   A comma-separated list of hours within which to set the core frequency to maximum.
715   Valid syntax includes individial hours '2,3,4', or a range of hours '2-4', or a
716   combination of both '1,3,5-7'. Valid hours are 0 to 23.
717
718   .. code-block:: console
719
720     --quiet-hours {list of quiet hours}
721
722   A comma-separated list of hours within which to set the core frequency to minimum.
723   Valid syntax includes individial hours '2,3,4', or a range of hours '2-4', or a
724   combination of both '1,3,5-7'. Valid hours are 0 to 23.
725
726   .. code-block:: console
727
728     --policy {policy type}
729
730   The type of policy. This can be one of the following values:
731   TRAFFIC - based on incoming traffic rates on the NIC.
732   TIME - busy/quiet hours policy.
733   BRANCH_RATIO - uses branch ratio counters to determine core busyness.
734   Not all parameters are needed for all policy types. For example, BRANCH_RATIO
735   only needs the vcpu-list parameter, not any of the hours.
736
737
738 After successful initialization the user is presented with VM Power Manager Guest CLI:
739
740 .. code-block:: console
741
742   vm_power(guest)>
743
744 To change the frequency of a lcore, use the set_cpu_freq command.
745 Where {core_num} is the lcore and channel to change frequency by scaling up/down/min/max.
746
747 .. code-block:: console
748
749   set_cpu_freq {core_num} up|down|min|max
750
751 To start the application and configure the power policy, and send it to the host:
752
753 .. code-block:: console
754
755  ./build/guest_vm_power_mgr -l 0-3 -n 4 -- --vm-name=ubuntu --policy=BRANCH_RATIO --vcpu-list=2-4
756
757 Once the VM Power Manager Guest CLI appears, issuing the 'send_policy now' command
758 will send the policy to the host:
759
760 .. code-block:: console
761
762   send_policy now
763
764 Once the policy is sent to the host, the host application takes over the power monitoring
765 of the specified cores in the policy.
766