diff options
author | Dave Barach <dave@barachs.net> | 2019-05-02 15:48:15 -0400 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2019-05-24 13:56:01 +0000 |
commit | 511ce2572a9710835c6722a09a93b4dd80ab7fae (patch) | |
tree | e91aa851cab7e9410aaa1a285cee53801bf51310 /src/vlib/main.h | |
parent | 070b810a883d789c97a9d89f56f952e14ed9999a (diff) |
Clean up multi-thread barrier-sync hold-down timerstable/1807
Main thread: don't bother with the barrier sync hold-down timer if
none of the worker threads are busy.
Worker threads: avoid epoll_pwait (10ms timeout) when the
control-plane has been active in the last half-second.
Cherry-pick a recent dangling reference fix: pool_elt_at_index after
e.g. rx callback is required, in case the unix file pool expands.
Manual feature backport to 18.07
Change-Id: I745fbb8a12aeda34b0ec7b6dcda66c0e25c3eee1
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlib/main.h')
-rw-r--r-- | src/vlib/main.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vlib/main.h b/src/vlib/main.h index 16e4120067d..894fe9efd6e 100644 --- a/src/vlib/main.h +++ b/src/vlib/main.h @@ -61,6 +61,9 @@ typedef struct vlib_main_t CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); /* Instruction level timing state. */ clib_time_t clib_time; + /* Offset from main thread time */ + f64 time_offset; + f64 time_last_barrier_release; /* Time stamp of last node dispatch. */ u64 cpu_time_last_node_dispatch; @@ -224,7 +227,7 @@ void vlib_worker_loop (vlib_main_t * vm); always_inline f64 vlib_time_now (vlib_main_t * vm) { - return clib_time_now (&vm->clib_time); + return clib_time_now (&vm->clib_time) + vm->time_offset; } always_inline f64 |