From patchwork Thu Jun 7 07:36:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hunt, David" X-Patchwork-Id: 40769 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2C1B91B3D4; Thu, 7 Jun 2018 16:39:54 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 724AB1B1E3 for ; Thu, 7 Jun 2018 16:39:52 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jun 2018 07:39:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,486,1520924400"; d="scan'208";a="62111488" Received: from silpixa00399952.ir.intel.com (HELO silpixa00399952.ger.corp.intel.com) ([10.237.223.64]) by fmsmga001.fm.intel.com with ESMTP; 07 Jun 2018 07:39:50 -0700 From: David Hunt To: dev@dpdk.org Cc: david.hunt@intel.com Date: Thu, 7 Jun 2018 08:36:59 +0100 Message-Id: <20180607073705.32895-1-david.hunt@intel.com> X-Mailer: git-send-email 2.17.0 Subject: [dpdk-dev] [PATCH v1 0/6] examples/vm_power: 100% Busy Polling 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch set adds the capability to do out-of-band power monitoring on a systemi by detecting when a core is doing 100% busy polling, but not handling any packets. It uses a thread to monitor the branch counters in the targeted cores, and calculates the branch ratio if the running code. If the branch ratop is low (0.01), then the code is most likely running in a tight poll loop and doing nothing, i.e. receiving no packets. In this case we scale down the frequency of that core. If the branch ratio is higher (>0.01), then it is likely that the code is receiving and processing packets. In this case, we scale up the frequency of that core. The cpu counters are read via /dev/cpu/x/msr, so requires the msr kernel module to be loaded. Because this method is used, the patch set is implemented with one file for x86 systems, and another for non-x86 systems, with conditional compilation in the Makefile. The non-x86 functions are stubs, and do not currently implement any functionality. The vm_power_manager app has been modified to take a new parameter --core-list or -l which takes a list of cores in a comma-separated list format, e.g. 1,3,5-7,9, which resolvest to a core list of 1,3,5,6,7,9 These cores will then be enabled for oob monitoring. When the OOB monitoring thread starts, it reads the branch hits/miss counters of each monitored core, and scales up/down accordingly. [1/6] examples/vm_power: add check for port count [2/6] examples/vm_power: add core list parameter [3/6] examples/vm_power: add oob monitoring functions [4/6] examples/vm_power: allow greater than 64 cores [5/6] examples/vm_power: add thread for oob core monitor [6/6] examples/vm_power: add port-list to command line