diff options
author | Donald Sharp <sharpd@nvidia.com> | 2022-01-19 20:56:25 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2022-01-20 17:58:48 +0100 |
commit | e8b3a2f74b707529c70908c6afc97a486588ef30 (patch) | |
tree | 33d0f5d910db7949be2c6d911e7a17cb225fafc6 /lib/thread.c | |
parent | lib: Figure out if we are being starved for cpu (diff) | |
download | frr-e8b3a2f74b707529c70908c6afc97a486588ef30.tar.xz frr-e8b3a2f74b707529c70908c6afc97a486588ef30.zip |
lib, zebra: Add ability to tell thread system to ignore late timers
Add a thread_ignore_late_timer(struct thread *thread) function
that allows thread.c to ignore when timers are late to the party.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib/thread.c')
-rw-r--r-- | lib/thread.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/thread.c b/lib/thread.c index 73e0e4887..376f61c24 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -787,6 +787,7 @@ static struct thread *thread_get(struct thread_master *m, uint8_t type, thread->arg = arg; thread->yield = THREAD_YIELD_TIME_SLOT; /* default */ thread->ref = NULL; + thread->ignore_timer_late = false; /* * So if the passed in funcname is not what we have @@ -1667,12 +1668,12 @@ static unsigned int thread_process_timers(struct thread_master *m, * really getting behind on handling of events. * Let's log it and do the right thing with it. */ - if (timercmp(timenow, &prev, >)) { - if (!displayed) - flog_warn( - EC_LIB_STARVE_THREAD, - "Thread Starvation: %pTHD was scheduled to pop greater than 4s ago", - thread); + if (!displayed && !thread->ignore_timer_late && + timercmp(timenow, &prev, >)) { + flog_warn( + EC_LIB_STARVE_THREAD, + "Thread Starvation: %pTHD was scheduled to pop greater than 4s ago", + thread); displayed = true; } |