From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D0819A0350; Thu, 25 Jun 2020 12:18:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A6CC9E07; Thu, 25 Jun 2020 12:18:01 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 04399DE0 for ; Thu, 25 Jun 2020 12:17:58 +0200 (CEST) IronPort-SDR: 14/NICUeR2JgiBs200Jaiyq4TvukYh3tduD6DFNqdnhP9oKPJo6iusQguUHBHtDdL5nM3cYAor fad+0MJJQFGw== X-IronPort-AV: E=McAfee;i="6000,8403,9662"; a="206363781" X-IronPort-AV: E=Sophos;i="5.75,278,1589266800"; d="scan'208";a="206363781" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2020 03:17:58 -0700 IronPort-SDR: GpwP6tw8LvtoDuEfffp6xE3l7knLF+sqrPlBJGyRVDDnmiaYY92BojiEdKSMuOoJpKd59JADRg xNY0fxZ5P5wA== X-IronPort-AV: E=Sophos;i="5.75,278,1589266800"; d="scan'208";a="452957873" Received: from dhunt5-mobl5.ger.corp.intel.com (HELO [10.213.237.42]) ([10.213.237.42]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2020 03:17:57 -0700 To: "Sexton, Rory" , dev@dpdk.org References: <20200518103902.27927-1-rory.sexton@intel.com> <20200518103902.27927-2-rory.sexton@intel.com> From: "Hunt, David" Message-ID: <33dc3a9f-b3ca-ac3a-0f02-148d24bf3b2b@intel.com> Date: Thu, 25 Jun 2020 11:17:56 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200518103902.27927-2-rory.sexton@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH v2 2/3] examples/vm_power_manager: Allowing power managing of idle cores 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" Hi Rory, On 18/5/2020 11:39 AM, Sexton, Rory wrote: > This change is required to allow the branch ratio algorithm to > power manage cores with no workload running on them. This is > useful both when idle cores don't use C-states and for a number of > hyperthreading scenarios. > > Signed-off-by: Rory Sexton > --- > examples/vm_power_manager/oob_monitor_x86.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/examples/vm_power_manager/oob_monitor_x86.c b/examples/vm_power_manager/oob_monitor_x86.c > index 3c514475f..a5b1c168c 100644 > --- a/examples/vm_power_manager/oob_monitor_x86.c > +++ b/examples/vm_power_manager/oob_monitor_x86.c > @@ -96,12 +96,12 @@ apply_policy(int core) > g_branch_misses = miss_diff; > > if (hits_diff < (INTERVAL*100)) { > - /* Likely no workload running on this core. Skip. */ > - return -1.0; > + /* Likely no workload running on this core. */ > + ratio = 0.0; > + } else { > + ratio = (float)miss_diff * (float)100 / (float)hits_diff; > } > > - ratio = (float)miss_diff * (float)100 / (float)hits_diff; > - > /* > * Store the last few directions that the ratio indicates > * we should take. If there's on 'up', then we scale up Good enhancement. It hadn't occurred to me to manage non-PMD workloads, but I agree that when C-States are disabled on a system, there may be cases where this algorithm is useful to save power. Reviewed-by: David Hunt