From aa6b6f081dd825016f26cc1c2abf74e29e601b70 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Fri, 18 Sep 2020 13:10:49 -0700 Subject: [PATCH] thread: Update thread->last_tsc at the start of polling It may have been a long time since the thread last executed so ensure this time is accurate. Signed-off-by: Ben Walker Change-Id: Iaa4c35b50cdc05ebb41724ed9946c5232d242ee3 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4321 Reviewed-by: Changpeng Liu Reviewed-by: Aleksey Marchuk Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins --- lib/thread/thread.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/thread/thread.c b/lib/thread/thread.c index f95f167d9..599a48b85 100644 --- a/lib/thread/thread.c +++ b/lib/thread/thread.c @@ -572,6 +572,8 @@ thread_poll(struct spdk_thread *thread, uint32_t max_msgs, uint64_t now) spdk_msg_fn critical_msg; int rc = 0; + thread->tsc_last = now; + critical_msg = thread->critical_msg; if (spdk_unlikely(critical_msg != NULL)) { critical_msg(NULL);