Loading lib/event/reactor.c +25 −15 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ #define SPDK_MAX_SOCKET 64 #define SPDK_REACTOR_SPIN_TIME_US 1000 #define SPDK_TIMER_POLL_ITERATIONS 5 #define SPDK_EVENT_BATCH_SIZE 8 enum spdk_poller_state { Loading Loading @@ -312,6 +312,7 @@ _spdk_reactor_run(void *arg) uint64_t idle_started, now; uint64_t spin_cycles, sleep_cycles; uint32_t sleep_us; uint32_t timer_poll_count; spdk_allocate_thread(); set_reactor_thread_name(reactor->lcore); Loading @@ -321,6 +322,7 @@ _spdk_reactor_run(void *arg) spin_cycles = SPDK_REACTOR_SPIN_TIME_US * spdk_get_ticks_hz() / 1000000ULL; sleep_cycles = reactor->max_delay_us * spdk_get_ticks_hz() / 1000000ULL; idle_started = 0; timer_poll_count = 0; while (1) { bool took_action = false; Loading @@ -344,6 +346,7 @@ _spdk_reactor_run(void *arg) took_action = true; } if (timer_poll_count >= SPDK_TIMER_POLL_ITERATIONS) { poller = TAILQ_FIRST(&reactor->timer_pollers); if (poller) { now = spdk_get_ticks(); Loading @@ -361,6 +364,10 @@ _spdk_reactor_run(void *arg) took_action = true; } } timer_poll_count = 0; } else { timer_poll_count++; } if (took_action) { /* We were busy this loop iteration. Reset the idle timer. */ Loading Loading @@ -392,6 +399,9 @@ _spdk_reactor_run(void *arg) if (sleep_us > 0) { usleep(sleep_us); } /* After sleeping, always poll for timers */ timer_poll_count = SPDK_TIMER_POLL_ITERATIONS; } } Loading Loading
lib/event/reactor.c +25 −15 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ #define SPDK_MAX_SOCKET 64 #define SPDK_REACTOR_SPIN_TIME_US 1000 #define SPDK_TIMER_POLL_ITERATIONS 5 #define SPDK_EVENT_BATCH_SIZE 8 enum spdk_poller_state { Loading Loading @@ -312,6 +312,7 @@ _spdk_reactor_run(void *arg) uint64_t idle_started, now; uint64_t spin_cycles, sleep_cycles; uint32_t sleep_us; uint32_t timer_poll_count; spdk_allocate_thread(); set_reactor_thread_name(reactor->lcore); Loading @@ -321,6 +322,7 @@ _spdk_reactor_run(void *arg) spin_cycles = SPDK_REACTOR_SPIN_TIME_US * spdk_get_ticks_hz() / 1000000ULL; sleep_cycles = reactor->max_delay_us * spdk_get_ticks_hz() / 1000000ULL; idle_started = 0; timer_poll_count = 0; while (1) { bool took_action = false; Loading @@ -344,6 +346,7 @@ _spdk_reactor_run(void *arg) took_action = true; } if (timer_poll_count >= SPDK_TIMER_POLL_ITERATIONS) { poller = TAILQ_FIRST(&reactor->timer_pollers); if (poller) { now = spdk_get_ticks(); Loading @@ -361,6 +364,10 @@ _spdk_reactor_run(void *arg) took_action = true; } } timer_poll_count = 0; } else { timer_poll_count++; } if (took_action) { /* We were busy this loop iteration. Reset the idle timer. */ Loading Loading @@ -392,6 +399,9 @@ _spdk_reactor_run(void *arg) if (sleep_us > 0) { usleep(sleep_us); } /* After sleeping, always poll for timers */ timer_poll_count = SPDK_TIMER_POLL_ITERATIONS; } } Loading