From 49ea880a77890b05a7b06cdf083122acb7f15a10 Mon Sep 17 00:00:00 2001 From: mbroyles Date: Thu, 7 Dec 2017 13:06:35 -0600 Subject: Wait two ticks prior to un-throttling memory due to power capping Disable 24x7 on first tick GPE exceeds tick time Only update snapshot buffer in active, observation or characterization states Change-Id: I388878623d8bb6af2dd2cb93b21bf1102d7877b9 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/50658 Tested-by: FSP CI Jenkins Reviewed-by: Christopher J. Cain Reviewed-by: William A. Bryan Reviewed-by: Martha Broyles --- src/occ_405/amec/amec_pcap.c | 19 +++++++++++++++---- src/occ_405/amec/amec_sensors_fw.c | 20 +++++++------------- src/occ_405/cmdh/cmdh_snapshot.c | 3 +-- 3 files changed, 23 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/occ_405/amec/amec_pcap.c b/src/occ_405/amec/amec_pcap.c index caf8419..d2295ee 100755 --- a/src/occ_405/amec/amec_pcap.c +++ b/src/occ_405/amec/amec_pcap.c @@ -43,6 +43,9 @@ //*************************************************************************/ #define PPB_NOM_DROP_DELAY 4 //ticks +//Number of consecutive ticks with power available to wait before un-throttling memory +#define UNTHROTTLE_MEMORY_DELAY 2 // ticks + //*************************************************************************/ // Structures //*************************************************************************/ @@ -337,6 +340,7 @@ void amec_pcap_calc(const bool i_oversub_state) uint32_t l_proc_fraction = 0; static uint32_t L_prev_node_pcap = 0; static bool L_apss_error_traced = FALSE; + static uint32_t L_ticks_mem_pwr_available = 0; // Determine the active power cap. norm_node_pcap is set as lowest // between sys (N+1 mode) and user in amec_data_write_pcap() @@ -400,10 +404,16 @@ void amec_pcap_calc(const bool i_oversub_state) if(l_avail_power >= mem_pwr_diff) { - TRAC_IMP("PCAP: Un-Throttling memory"); - g_amec->pcap.active_mem_level = 0; - // don't let the proc have any available power this tick - l_avail_power = 0; + L_ticks_mem_pwr_available++; + + if(L_ticks_mem_pwr_available == UNTHROTTLE_MEMORY_DELAY) + { + TRAC_IMP("PCAP: Un-Throttling memory"); + g_amec->pcap.active_mem_level = 0; + L_ticks_mem_pwr_available = 0; + // don't let the proc have any available power this tick + l_avail_power = 0; + } } } // check if need to reduce power and frequency is already at the min @@ -415,6 +425,7 @@ void amec_pcap_calc(const bool i_oversub_state) { TRAC_IMP("PCAP: Throttling memory"); g_amec->pcap.active_mem_level = 1; + L_ticks_mem_pwr_available = 0; } } else diff --git a/src/occ_405/amec/amec_sensors_fw.c b/src/occ_405/amec/amec_sensors_fw.c index daf9fd7..6c5a1c0 100644 --- a/src/occ_405/amec/amec_sensors_fw.c +++ b/src/occ_405/amec/amec_sensors_fw.c @@ -103,7 +103,6 @@ void task_gpe_timings(task_t * i_task) static bool L_first_call = TRUE; bool l_gpe0_idle = TRUE; bool l_gpe1_idle = TRUE; - static uint8_t L_consec_trace_count[2] = {0}; gpe_gpenxiramdbg_t xsr_sprg0 = {0}; gpe_gpenxiramedr_t ir_edr = {0}; @@ -251,32 +250,27 @@ void task_gpe_timings(task_t * i_task) { // Reset how many consecutive ticks we were busy for. L_busyTicks = 0; + L_idleTicks++; - // If we were idle for at least 16 consecutive ticks, enable 24x7 - if( L_idleTicks >= 15 ) + // If we were idle for a complete cycle thru all ticks, re-enable 24x7 + if( L_idleTicks >= MAX_NUM_TICKS ) { G_24x7_disabled = FALSE; } - else - { - L_idleTicks++; - } } else { // Reset how many consecutive ticks we were idle for L_idleTicks = 0; + L_busyTicks++; - // If we were busy for at least 2 consecutive ticks, disable 24x7 - if( L_busyTicks >= 1 ) + // disable 24x7 if it isn't already, this will stay disabled until we can run all + // ticks consecutively + if( !G_24x7_disabled ) { G_24x7_disabled = TRUE; INCREMENT_ERR_HISTORY(ERRH_24X7_DISABLED); } - else - { - L_busyTicks++; - } } L_first_call = FALSE; diff --git a/src/occ_405/cmdh/cmdh_snapshot.c b/src/occ_405/cmdh/cmdh_snapshot.c index a457f5e..ecb9afc 100755 --- a/src/occ_405/cmdh/cmdh_snapshot.c +++ b/src/occ_405/cmdh/cmdh_snapshot.c @@ -382,9 +382,8 @@ void cmdh_snapshot_callback(void * arg) g_cmdh_snapshot_reset = FALSE; g_cmdh_snapshot_cur_index = CMDH_SNAPSHOT_DEFAULT_CUR_INDEX; } - else + else if (IS_OCC_STATE_OBSERVATION() || IS_OCC_STATE_ACTIVE() || IS_OCC_STATE_CHARACTERIZATION()) { - uint32_t l_pwr_accum_diff = 0; uint32_t l_pwr_uptag_diff = 0; -- cgit v1.2.1