From aa88ac251a8f036165b44435b76e0dce66e5247a Mon Sep 17 00:00:00 2001 From: Stephen Glancy Date: Mon, 25 Sep 2017 15:37:42 -0500 Subject: [PATCH] Updates DRAM minimum utilization to 25% Change-Id: I7af6a56573e5190607977e5743055b4dc02f2511 CQ:SW396389 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/46696 Tested-by: FSP CI Jenkins Reviewed-by: JACOB L. HARVEY Tested-by: Jenkins Server Tested-by: HWSV CI Tested-by: Hostboot CI Reviewed-by: Louis Stermole Reviewed-by: ANDRE A. MARIN Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/46706 Tested-by: Jenkins OP Build CI Reviewed-by: Daniel M. Crowell --- .../hwp/memory/lib/power_thermal/throttle.C | 12 +++++++++--- .../hwp/memory/lib/power_thermal/throttle.H | 11 +++++++++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.C b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.C index ee15073e5af..ac0c1b7399c 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.C @@ -49,6 +49,7 @@ namespace mss { namespace power_thermal { + /// /// @brief Constructor /// @param[in] i_target MCS target to call power thermal stuff on @@ -458,8 +459,13 @@ void throttle::calc_util_usage(const uint32_t i_slope, //Cast to uint32 for edge case where it has decimals o_util = (static_cast(o_util) < iv_databus_port_max) ? static_cast(o_util) : iv_databus_port_max; - //Can't have zero - o_util = (o_util == 0) ? MIN_UTIL : o_util; + // Check for the minimum threshnold and update if need be + if(o_util < MIN_UTIL) + { + FAPI_INF("Calculated utilization (%lu) is less than the minimum utilization: %lu. Setting to minimum value", o_util, + MIN_UTIL); + o_util = MIN_UTIL; + } } /// @@ -721,7 +727,7 @@ fapi_try_exit: /// fapi2::ReturnCode set_runtime_m_and_watt_limit( const std::vector< fapi2::Target >& i_targets ) { - uint32_t l_m_clocks; + uint32_t l_m_clocks = 0; uint32_t l_vmem_power_limit_dimm = 0; uint8_t l_max_dimms = 0; diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.H b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.H index 70156eb0469..637d1be79f6 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.H @@ -57,7 +57,7 @@ enum throttle_const : size_t PERCENT_CONVERSION = 100, /// MIN_UTIL is in c% - MIN_UTIL = 100, + MIN_UTIL = 2500, /// IDLE_UTIL is in c% IDLE_UTIL = 0, @@ -264,6 +264,7 @@ inline uint32_t throttled_cmds(const uint32_t i_databus_util, const uint32_t i_n /// /// @brief Calculate the port databus utilization based off of N throttles and M dram clocks +/// @tparam T output type /// @param[in] i_n_throttles N (address operations) allowed within a window of M DRAM clocks /// @param[in] i_num_dram_clocks window of M DRAM clocks /// @param[out] o_calc_util @@ -296,7 +297,13 @@ fapi2::ReturnCode calc_util_from_throttles(const uint16_t i_n_throttles, l_multiplier, i_num_dram_clocks); - o_calc_util = ( (o_calc_util == 0) ? MIN_UTIL : o_calc_util); + // Check for the minimum + if(o_calc_util < MIN_UTIL) + { + FAPI_INF("Calculated utilization (%lu) is less than the minimum utilization: %lu. Setting to minimum value", + o_calc_util, MIN_UTIL); + o_calc_util = MIN_UTIL; + } FAPI_INF("In calc_util_from_throttles, calculated %d for output utilization", o_calc_util); return fapi2::FAPI2_RC_SUCCESS;