Skip to content

add per-core Turbo Boost capability

David Hunt dpdk-dev 2 versions – Applied

Status from this message: Applied, thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 3 repliesApplied
  2. v14 patches 0 repliesSuperseded

Changes in v2 from the cover letter

* Removed wrmsr/rdmsr functions as they were very architecture specific. Now using the scaling_setspeed in the sys filesystem, as this is a more standard cross-platform method of changing frequencies (where available).
* Removed patch that checks for particular models of CPU, as they are no longer needed with the above change.
* Added APIs to the docs.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/4lib/librte_power: add turbo boost APIlib/librte_power/channel_commands.h lib/librte_power/rte_power.c lib/librte_power/rte_power.h +4 more+255 -221 replies
2/4examples/vm_power_manager: add per-core turboexamples/vm_power_manager/channel_monitor.c examples/vm_power_manager/power_manager.c examples/vm_power_manager/power_manager.h +1 more+114 -70 replies
3/4examples/vm_power_cli_guest: add per-core turboexamples/vm_power_manager/guest_cli/vm_power_cli_guest.c+5 -10 replies
4/4doc/power: add information on per-core turbo APIsdoc/guides/prog_guide/power_man.rst+12 -02 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchJohn McNamaraSantosh ShuklaKonstantin Ananyev
1/4R-b R-b R-b R-b R-b R-b R-b R-b R-b A-b A-b A-b A-b A-b A-b A-b A-b A-b
2/4
3/4
4/4A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/4] add per-core Turbo Boost capability

Recent generations of the Intel® Xeon® family processors allow Turbo Boost to be enabled/disabled on a per-core basis.

This patch set introduces additional API calls to the librte_power library to allow users to enable/disable Turbo Boost on particular cores.

Changes in patchset v2:
* Removed wrmsr/rdmsr functions as they were very architecture specific. Now using the scaling_setspeed in the sys filesystem, as this is a more standard cross-platform method of changing frequencies (where available).
* Removed patch that checks for particular models of CPU, as they are no longer needed with the above change.
* Added APIs to the docs.

Additionally, the use of the library is demonstrated by additions to the vm_power_manager example application, where the new commands have been added to allow the turbo status of cores to be changed dynamically.

Extra message types have been added to the virtio-serial channels between the guest_vm_power_manager app and the vm_power_manager apps to demonstrate turbo change requests from a virtual machine. In this case, the guest will send a request to the physical host, which in turn will change the state of the turbo status.

Usage Example:
--------------

A VM has been created using 8 CPU cores, and 8 virtio-serial channels have been created as per-core communications channels between the host and the VM.

See: http://www.dpdk.org/doc/guides/sample_app_ug/vm_power_management.html
for more information on setting up the vm_power applications.

In the vm_power_manager app on the host, we can query these channels:
vmpower> show_vm ubuntu2

VM: 'ubuntu2', status = ACTIVE
Channels 8
[0]: /tmp/powermonitor/ubuntu2.0, status = CONNECTED [1]: /tmp/powermonitor/ubuntu2.1, status = CONNECTED [2]: /tmp/powermonitor/ubuntu2.2, status = CONNECTED [3]: /tmp/powermonitor/ubuntu2.3, status = CONNECTED [4]: /tmp/powermonitor/ubuntu2.4, status = CONNECTED [5]: /tmp/powermonitor/ubuntu2.5, status = CONNECTED [6]: /tmp/powermonitor/ubuntu2.6, status = CONNECTED [7]: /tmp/powermonitor/ubuntu2.7, status = CONNECTED
Virtual CPU(s): 8
[0]: Physical CPU Mask 0x100000
[1]: Physical CPU Mask 0x200000
[2]: Physical CPU Mask 0x400000
[3]: Physical CPU Mask 0x800000
[4]: Physical CPU Mask 0x1000000
[5]: Physical CPU Mask 0x2000000
[6]: Physical CPU Mask 0x4000000
[7]: Physical CPU Mask 0x8000000

Once the VM is up and running, if we exercise all the cores on the guest, we can use turbostat on the host to see the frequencies of the guest cores. In this example, it's cores 20-27:

      19       0    0.01    2500    2500
      20    2498  100.00    2500    2498
      21    2498  100.00    2500    2498
      22    2498  100.00    2500    2498
      23    2498  100.00    2500    2498
      24   *2498  100.00    2500    2498
      25    2498  100.00    2500    2498
      26    2498  100.00    2500    2498
      27    2498  100.00    2500    2498
      28       0    0.01    2032    2498

We can then issue a command in the vmpower app on the guest:

vmpower(guest)> set_cpu_freq 4 enable_turbo

This command will pass a message down through virtio-serial to the host, which will enable turbo on core 24, the underlying physical core for the guest's 4th lcore_id. We can then see the change by running turbostat on the host:

      19       0    0.01    2500    2496
      20    2498  100.00    2500    2498
      21    2498  100.00    2500    2498
      22    2498  100.00    2500    2498
      23    2498  100.00    2500    2498
      24   *3297  100.00    3300    2498
      25    2498  100.00    2500    2498
      26    2498  100.00    2500    2498
      27    2498  100.00    2500    2498
      28       0    0.01    1016    2498

Core 24 is now running at 3300MHz, whereas the remainder are still running at 2500MHz.

We can issue a similar command in the vm_power_manager running on the host to disable turbo on that core, but this time we use the physical core id:

vmpower> set_cpu_freq 24 disable_turbo

and we see that turbo is now disabled on that core.

      19       0    0.00    2500    2495
      20    2499  100.00    2500    2499
      21    2499  100.00    2500    2499
      22    2499  100.00    2500    2499
      23    2499  100.00    2500    2499
      24   *2499  100.00    2500    2499
      25    2499  100.00    2500    2499
      26    2499  100.00    2500    2499
      27    2499  100.00    2500    2499
      28       0    0.01    1000    2499

[1/4] lib/librte_power: add turbo boost API [2/4] examples/vm_power_manager: add per-core turbo [3/4] examples/vm_power_cli_guest: add per-core turbo [4/4] doc/power: add information on per-core turbo APIs