lib/event: rename core_busy/idle_tsc to total_busy/idle_tsc
Renamed core_busy_tsc and core_idle_tsc to better describe that they contain particular core stats for its whole lifetime. Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Change-Id: I6f16b2b0a162aad8fbaf18f549fc50a2372b920b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8047 Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot
This commit is contained in:
parent
902c9e4de7
commit
e837ba3bde
@ -259,8 +259,10 @@ struct spdk_governor *_spdk_governor_get(void);
|
||||
* A list of cores and threads which is used for scheduling.
|
||||
*/
|
||||
struct spdk_scheduler_core_info {
|
||||
uint64_t core_idle_tsc;
|
||||
uint64_t core_busy_tsc;
|
||||
/* stats over a lifetime of a core */
|
||||
uint64_t total_idle_tsc;
|
||||
uint64_t total_busy_tsc;
|
||||
|
||||
uint32_t lcore;
|
||||
uint32_t threads_count;
|
||||
uint32_t pending_threads_count;
|
||||
|
@ -89,7 +89,7 @@ balance(struct spdk_scheduler_core_info *cores, int core_count, struct spdk_gove
|
||||
|
||||
turbo_available = (capabilities.turbo_available && capabilities.turbo_set) ? true : false;
|
||||
|
||||
if (core->core_busy_tsc < (core->core_idle_tsc / 1000)) {
|
||||
if (core->total_busy_tsc < (core->total_idle_tsc / 1000)) {
|
||||
rc = governor->set_core_freq_min(core->lcore);
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("setting to minimal frequency for core %u failed\n", core->lcore);
|
||||
@ -103,7 +103,7 @@ balance(struct spdk_scheduler_core_info *cores, int core_count, struct spdk_gove
|
||||
}
|
||||
|
||||
SPDK_DEBUGLOG(reactor, "setting to minimal frequency for core: %u\n", core->lcore);
|
||||
} else if (core->core_idle_tsc > core->core_busy_tsc) {
|
||||
} else if (core->total_idle_tsc > core->total_busy_tsc) {
|
||||
rc = governor->core_freq_down(core->lcore);
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("lowering frequency for core %u failed\n", core->lcore);
|
||||
@ -117,7 +117,7 @@ balance(struct spdk_scheduler_core_info *cores, int core_count, struct spdk_gove
|
||||
}
|
||||
|
||||
SPDK_DEBUGLOG(reactor, "lowering frequency for core: %u\n", core->lcore);
|
||||
} else if (core->core_idle_tsc < (core->core_busy_tsc / 1000)) {
|
||||
} else if (core->total_idle_tsc < (core->total_busy_tsc / 1000)) {
|
||||
rc = governor->set_core_freq_max(core->lcore);
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("setting to maximal frequency for core %u failed\n", core->lcore);
|
||||
|
@ -792,8 +792,8 @@ _reactors_scheduler_gather_metrics(void *arg1, void *arg2)
|
||||
reactor->flags.is_scheduling = true;
|
||||
core_info = &g_core_infos[reactor->lcore];
|
||||
core_info->lcore = reactor->lcore;
|
||||
core_info->core_idle_tsc = reactor->idle_tsc;
|
||||
core_info->core_busy_tsc = reactor->busy_tsc;
|
||||
core_info->total_idle_tsc = reactor->idle_tsc;
|
||||
core_info->total_busy_tsc = reactor->busy_tsc;
|
||||
core_info->interrupt_mode = reactor->in_interrupt;
|
||||
|
||||
SPDK_DEBUGLOG(reactor, "Gathering metrics on %u\n", reactor->lcore);
|
||||
|
@ -139,10 +139,10 @@ balance(struct spdk_scheduler_core_info *cores_info, int cores_count,
|
||||
uint8_t load;
|
||||
bool busy_threads_present = false;
|
||||
|
||||
main_core_busy = cores_info[g_main_lcore].core_busy_tsc - g_last_main_core_busy;
|
||||
main_core_idle = cores_info[g_main_lcore].core_idle_tsc - g_last_main_core_idle;
|
||||
g_last_main_core_busy = cores_info[g_main_lcore].core_busy_tsc;
|
||||
g_last_main_core_idle = cores_info[g_main_lcore].core_idle_tsc;
|
||||
main_core_busy = cores_info[g_main_lcore].total_busy_tsc - g_last_main_core_busy;
|
||||
main_core_idle = cores_info[g_main_lcore].total_idle_tsc - g_last_main_core_idle;
|
||||
g_last_main_core_busy = cores_info[g_main_lcore].total_busy_tsc;
|
||||
g_last_main_core_idle = cores_info[g_main_lcore].total_idle_tsc;
|
||||
|
||||
SPDK_ENV_FOREACH_CORE(i) {
|
||||
cores_info[i].pending_threads_count = cores_info[i].threads_count;
|
||||
|
Loading…
Reference in New Issue
Block a user