From 3184f6e22793fcb00f0b2d8b5fd79ab0d430b243 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Wed, 22 Sep 2021 10:59:43 -0700 Subject: [PATCH] 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 Change-Id: Idf815f67c71463c3b98bc00211aafdc291abdbd2 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9582 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Ben Walker --- module/scheduler/dynamic/scheduler_dynamic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/scheduler/dynamic/scheduler_dynamic.c b/module/scheduler/dynamic/scheduler_dynamic.c index 1d5bf424f..c15684687 100644 --- a/module/scheduler/dynamic/scheduler_dynamic.c +++ b/module/scheduler/dynamic/scheduler_dynamic.c @@ -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; }