event: Remove timer poll count checks
This removes checks for timer poll iterations within a reactor. Change-Id: Id8eea26dab201064123575998b3b24e1f609ac5a Signed-off-by: Vishal Verma <vishal4.verma@intel.com> Reviewed-on: https://review.gerrithub.io/412694 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
919252ce5e
commit
48738e383d
@ -45,7 +45,6 @@
|
|||||||
#define SPDK_MAX_SOCKET 64
|
#define SPDK_MAX_SOCKET 64
|
||||||
|
|
||||||
#define SPDK_REACTOR_SPIN_TIME_USEC 1000
|
#define SPDK_REACTOR_SPIN_TIME_USEC 1000
|
||||||
#define SPDK_TIMER_POLL_ITERATIONS 5
|
|
||||||
#define SPDK_EVENT_BATCH_SIZE 8
|
#define SPDK_EVENT_BATCH_SIZE 8
|
||||||
#define SPDK_SEC_TO_USEC 1000000ULL
|
#define SPDK_SEC_TO_USEC 1000000ULL
|
||||||
|
|
||||||
@ -439,7 +438,6 @@ _spdk_reactor_run(void *arg)
|
|||||||
uint64_t idle_started, now;
|
uint64_t idle_started, now;
|
||||||
uint64_t spin_cycles, sleep_cycles;
|
uint64_t spin_cycles, sleep_cycles;
|
||||||
uint32_t sleep_us;
|
uint32_t sleep_us;
|
||||||
uint32_t timer_poll_count;
|
|
||||||
char thread_name[32];
|
char thread_name[32];
|
||||||
|
|
||||||
snprintf(thread_name, sizeof(thread_name), "reactor_%u", reactor->lcore);
|
snprintf(thread_name, sizeof(thread_name), "reactor_%u", reactor->lcore);
|
||||||
@ -455,7 +453,6 @@ _spdk_reactor_run(void *arg)
|
|||||||
spin_cycles = SPDK_REACTOR_SPIN_TIME_USEC * spdk_get_ticks_hz() / SPDK_SEC_TO_USEC;
|
spin_cycles = SPDK_REACTOR_SPIN_TIME_USEC * spdk_get_ticks_hz() / SPDK_SEC_TO_USEC;
|
||||||
sleep_cycles = reactor->max_delay_us * spdk_get_ticks_hz() / SPDK_SEC_TO_USEC;
|
sleep_cycles = reactor->max_delay_us * spdk_get_ticks_hz() / SPDK_SEC_TO_USEC;
|
||||||
idle_started = 0;
|
idle_started = 0;
|
||||||
timer_poll_count = 0;
|
|
||||||
if (g_context_switch_monitor_enabled) {
|
if (g_context_switch_monitor_enabled) {
|
||||||
_spdk_reactor_context_switch_monitor_start(reactor, NULL);
|
_spdk_reactor_context_switch_monitor_start(reactor, NULL);
|
||||||
}
|
}
|
||||||
@ -481,27 +478,22 @@ _spdk_reactor_run(void *arg)
|
|||||||
took_action = true;
|
took_action = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timer_poll_count >= SPDK_TIMER_POLL_ITERATIONS) {
|
poller = TAILQ_FIRST(&reactor->timer_pollers);
|
||||||
poller = TAILQ_FIRST(&reactor->timer_pollers);
|
if (poller) {
|
||||||
if (poller) {
|
now = spdk_get_ticks();
|
||||||
now = spdk_get_ticks();
|
|
||||||
|
|
||||||
if (now >= poller->next_run_tick) {
|
if (now >= poller->next_run_tick) {
|
||||||
TAILQ_REMOVE(&reactor->timer_pollers, poller, tailq);
|
TAILQ_REMOVE(&reactor->timer_pollers, poller, tailq);
|
||||||
poller->state = SPDK_POLLER_STATE_RUNNING;
|
poller->state = SPDK_POLLER_STATE_RUNNING;
|
||||||
poller->fn(poller->arg);
|
poller->fn(poller->arg);
|
||||||
if (poller->state == SPDK_POLLER_STATE_UNREGISTERED) {
|
if (poller->state == SPDK_POLLER_STATE_UNREGISTERED) {
|
||||||
free(poller);
|
free(poller);
|
||||||
} else {
|
} else {
|
||||||
poller->state = SPDK_POLLER_STATE_WAITING;
|
poller->state = SPDK_POLLER_STATE_WAITING;
|
||||||
_spdk_poller_insert_timer(reactor, poller, now);
|
_spdk_poller_insert_timer(reactor, poller, now);
|
||||||
}
|
|
||||||
took_action = true;
|
|
||||||
}
|
}
|
||||||
|
took_action = true;
|
||||||
}
|
}
|
||||||
timer_poll_count = 0;
|
|
||||||
} else {
|
|
||||||
timer_poll_count++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (took_action) {
|
if (took_action) {
|
||||||
@ -536,8 +528,6 @@ _spdk_reactor_run(void *arg)
|
|||||||
usleep(sleep_us);
|
usleep(sleep_us);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* After sleeping, always poll for timers */
|
|
||||||
timer_poll_count = SPDK_TIMER_POLL_ITERATIONS;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user