Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D638C433E3 for ; Mon, 13 Jul 2020 15:11:34 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id E24042075D for ; Mon, 13 Jul 2020 15:11:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E24042075D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 272DD1D635; Mon, 13 Jul 2020 17:11:27 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 6B8221D37F for ; Mon, 13 Jul 2020 17:11:24 +0200 (CEST) IronPort-SDR: etjEmuU6lb7nzvrbq8qBrwGrHM/SDzCJW4pFL3WDGf9N+A1S09AY20Jd6o1HZVSmVV4xmJO+UC s6boVfA6K1ww== X-IronPort-AV: E=McAfee;i="6000,8403,9681"; a="146660914" X-IronPort-AV: E=Sophos;i="5.75,347,1589266800"; d="scan'208";a="146660914" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2020 08:11:22 -0700 IronPort-SDR: 74HMMbmxA4yMTQwp+YoKDrhb17yRqh6QD5B02SBlEmANcmyyDDkuPY1R05j6rzZ98JlBmcxxj2 z9d2AFLWgVtw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,347,1589266800"; d="scan'208";a="485521559" Received: from silpixa00399913.ir.intel.com ([10.237.213.189]) by fmsmga005.fm.intel.com with ESMTP; 13 Jul 2020 08:11:21 -0700 From: Rory Sexton To: dev@dpdk.org, david.hunt@intel.com Date: Mon, 13 Jul 2020 16:11:19 +0100 Message-Id: <20200713151120.957342-2-rory.sexton@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200713151120.957342-1-rory.sexton@intel.com> References: <20200713151120.957342-1-rory.sexton@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [v3 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" 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 Reviewed-by: David Hunt --- 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 -- 2.25.1