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>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
0.01 but will need adjustment for different workloads
This parameter can be used multiple times for different sets of cores.
+ The branch ratio mechanism can also be useful for non-PMD cores and
+ hyper-threaded environments where C-States are disabled.
Compiling and Running the Guest Applications
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