scheduler/dynamic: rename _is_core_over_limit()

Rename it to _is_core_at_limit().  This function
currently returns true if the core is at the limit
(instead of over the limit) which is really the semantics
that we want - so just change the name of the function
to make it more precise.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Idf815f67c71463c3b98bc00211aafdc291abdbd2

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9582
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Jim Harris 2021-09-22 10:59:43 -07:00 committed by Tomasz Zawadzki
parent cf494305bf
commit 3184f6e227

View File

@ -139,7 +139,7 @@ _move_thread(struct spdk_scheduler_thread_info *thread_info, uint32_t dst_core)
}
static bool
_is_core_over_limit(uint32_t core_id)
_is_core_at_limit(uint32_t core_id)
{
struct core_stats *core = &g_cores[core_id];
uint64_t busy, idle;
@ -208,7 +208,7 @@ _find_optimal_core(struct spdk_scheduler_thread_info *thread_info)
uint32_t least_busy_lcore = thread_info->lcore;
struct spdk_thread *thread;
struct spdk_cpuset *cpumask;
bool core_over_limit = _is_core_over_limit(current_lcore);
bool core_at_limit = _is_core_at_limit(current_lcore);
thread = spdk_thread_get_by_id(thread_info->thread_id);
if (thread == NULL) {
@ -236,7 +236,7 @@ _find_optimal_core(struct spdk_scheduler_thread_info *thread_info)
if (i < current_lcore) {
/* Lower core id was found, move to consolidate threads on lowest core ids. */
return i;
} else if (core_over_limit) {
} else if (core_at_limit) {
/* When core is over the limit, even higher core ids are better than current one. */
return i;
}
@ -244,7 +244,7 @@ _find_optimal_core(struct spdk_scheduler_thread_info *thread_info)
/* For cores over the limit, place the thread on least busy core
* to balance threads. */
if (core_over_limit) {
if (core_at_limit) {
return least_busy_lcore;
}