All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Sexton, Rory" <rory.sexton@intel.com>
To: dev@dpdk.org, david.hunt@intel.com
Cc: "Sexton, Rory" <rory.sexton@intel.com>
Subject: [dpdk-dev] [PATCH v1 2/3] examples/vm_power_manager: Allowing power managing of idle cores
Date: Mon, 18 May 2020 11:12:10 +0100	[thread overview]
Message-ID: <20200518101211.26025-2-rory.sexton@intel.com> (raw)
In-Reply-To: <20200518101211.26025-1-rory.sexton@intel.com>

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.
---
 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.17.1


  reply	other threads:[~2020-05-18 10:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18 10:12 [dpdk-dev] [PATCH v1 1/3] examples/vm_power_manager: Make branch ratio threshold per core Sexton, Rory
2020-05-18 10:12 ` Sexton, Rory [this message]
2020-05-18 10:12 ` [dpdk-dev] [PATCH v1 3/3] doc: update vm_power_manager cmdline options in doc Sexton, Rory
2020-05-18 10:59   ` Sexton, Rory

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200518101211.26025-2-rory.sexton@intel.com \
    --to=rory.sexton@intel.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.