From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id D20141E2F for ; Fri, 13 Jul 2018 16:23:19 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jul 2018 07:23:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,347,1526367600"; d="scan'208";a="56278177" Received: from silpixa00399952.ir.intel.com (HELO silpixa00399952.ger.corp.intel.com) ([10.237.223.64]) by orsmga007.jf.intel.com with ESMTP; 13 Jul 2018 07:23:17 -0700 From: David Hunt To: dev@dpdk.org Cc: david.hunt@intel.com, thomas@monjalon.net Date: Fri, 13 Jul 2018 15:22:53 +0100 Message-Id: <20180713142302.34576-1-david.hunt@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180626092317.11031-2-david.hunt@intel.com> References: <20180626092317.11031-2-david.hunt@intel.com> Subject: [dpdk-dev] [PATCH v4 0/9] 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: , X-List-Received-Date: Fri, 13 Jul 2018 14:23:20 -0000 This patch set adds the capability to do out-of-band power monitoring on a system. 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 ratio 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. The guest_cli app has also been modified to allow sending of a policy of type BRANCH_RATIO where all of the cores included in the policy will be monitored by the vm_power_manager oob thread. v2 changes: * Add the guest_cli patch into this patch set, including the ability to set the policy to BRANCH_RATIO. http://patches.dpdk.org/patch/40742/ * When vm_power_manger receives a policy with type BRANCH_RATIO, add the relevant cores to the monitoring thread. v3 changes: * Added a command line parameter to allow changing of the default branch ratio threshold. can now use -b 0.3 or --branch-ratio=0.3 to set the ratio for scaling up/down. v4 changes: * Removed some un-needed header file includes [1/9] examples/vm_power: add check for port count [2/9] examples/vm_power: add core list parameter [3/9] examples/vm_power: add oob monitoring functions [4/9] examples/vm_power: allow greater than 64 cores [5/9] examples/vm_power: add thread for oob core monitor [6/9] examples/vm_power: add port-list to command line [7/9] examples/vm_power: add branch ratio policy type [8/9] examples/vm_power: add cli args to guest app [9/9] examples/vm_power: make branch ratio configurable