Commit 584fb373 authored by Maciej Szwed's avatar Maciej Szwed Committed by Tomasz Zawadzki
Browse files

scheduler: copy snapshot of thread stats to new spdk_lw_thread field



This will be used by a scheduler while balancing threads
to get information how much busy a thread is.

Signed-off-by: default avatarMaciej Szwed <maciej.szwed@intel.com>
Change-Id: Ib0e897a9bb5d2a71173f60cce7e1d442e67a57f9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5253


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 75022aa2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ struct spdk_lw_thread {
	uint32_t                        new_lcore;
	bool				resched;
	struct spdk_thread_stats	current_stats;
	struct spdk_thread_stats	snapshot_stats;
};

struct spdk_reactor {
+1 −0
Original line number Diff line number Diff line
@@ -581,6 +581,7 @@ _reactors_scheduler_gather_metrics(void *arg1, void *arg2)
		i = 0;
		TAILQ_FOREACH(lw_thread, &reactor->threads, link) {
			core_info->threads[i] = lw_thread;
			_spdk_lw_thread_get_current_stats(lw_thread, &lw_thread->snapshot_stats);
			i++;
		}
	}