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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git