From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 466017D12 for ; Tue, 22 Aug 2017 18:12:36 +0200 (CEST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2017 09:12:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,412,1498546800"; d="scan'208";a="142675182" Received: from silpixa00397898.ir.intel.com (HELO silpixa00397898.ger.corp.intel.com) ([10.237.223.116]) by fmsmga005.fm.intel.com with ESMTP; 22 Aug 2017 09:12:06 -0700 From: David Hunt To: dev@dpdk.org Cc: david.hunt@intel.com Date: Tue, 22 Aug 2017 17:11:46 +0100 Message-Id: <1503418310-162535-1-git-send-email-david.hunt@intel.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v1 0/4] add per-core Turbo Boost capability X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Aug 2017 16:12:37 -0000 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. 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 per-core turbo capability [2/4] examples/vm_power_manager: add per-core turbo [3/4] examples/vm_power_cli_guest: add per-core turbo [4/4] lib: limit turbo to particular models of CPU