DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rory Sexton <rory.sexton@intel.com>
To: dev@dpdk.org, david.hunt@intel.com
Subject: [dpdk-dev] [v4 2/3] examples/vm_power_manager: Allowing power managing of idle cores
Date: Tue, 14 Jul 2020 17:01:59 +0100	[thread overview]
Message-ID: <20200714160200.1727417-2-rory.sexton@intel.com> (raw)
In-Reply-To: <20200714160200.1727417-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.

Signed-off-by: Rory Sexton <rory.sexton@intel.com>
Reviewed-by: David Hunt <david.hunt@intel.com>

---
v4: no changes
---
 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


  reply	other threads:[~2020-07-14 16:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14 16:01 [dpdk-dev] [v4 1/3] examples/vm_power_manager: Make branch ratio threshold per core Rory Sexton
2020-07-14 16:01 ` Rory Sexton [this message]
2020-07-15 15:09   ` [dpdk-dev] [v4 2/3] examples/vm_power_manager: Allowing power managing of idle cores Pattan, Reshma
2020-07-14 16:02 ` [dpdk-dev] [v4 3/3] doc: update vm_power_manager cmdline options in doc Rory Sexton
2020-07-15 15:15   ` Pattan, Reshma
2020-07-17 12:31   ` Thomas Monjalon
2020-07-15 15:08 ` [dpdk-dev] [v4 1/3] examples/vm_power_manager: Make branch ratio threshold per core Pattan, Reshma
2020-07-17 12:40   ` Thomas Monjalon
2020-07-20 10:26     ` 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=20200714160200.1727417-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).