X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fvm_power_manager%2Foob_monitor_x86.c;h=a5b1c168c3c86cefa05253ef886881e00edbfc24;hb=41515403f1841c7444c648c21dc355c6fe258709;hp=aecfcb2ebf8a8151921353dc989a302bbc760991;hpb=31c9a66465ad623258c4449fea54c0b42a2deae1;p=dpdk.git diff --git a/examples/vm_power_manager/oob_monitor_x86.c b/examples/vm_power_manager/oob_monitor_x86.c index aecfcb2ebf..a5b1c168c3 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 @@ -109,7 +109,7 @@ apply_policy(int core) * down. Each core_details struct has it's own array. */ freq_window_idx = ci->cd[core].freq_window_idx; - if (ratio > ci->branch_ratio_threshold) + if (ratio > ci->cd[core].branch_ratio_threshold) ci->cd[core].freq_directions[freq_window_idx] = 1; else ci->cd[core].freq_directions[freq_window_idx] = 0;