thread: Check if timed poller is expired first in iteration of thread_poll()
There will be no issue even if time poller is unregistered or paused after it is expired. The iteration is stopped anyway after the head poller is found not to be expired. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I2b394b8b517930a6630dd31f59fcaea12eb80572 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7662 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
cd83ea4a6d
commit
84ec998976
@ -669,6 +669,10 @@ thread_poll(struct spdk_thread *thread, uint32_t max_msgs, uint64_t now)
|
||||
TAILQ_FOREACH_SAFE(poller, &thread->timed_pollers, tailq, tmp) {
|
||||
int timer_rc = 0;
|
||||
|
||||
if (now < poller->next_run_tick) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (poller->state == SPDK_POLLER_STATE_UNREGISTERED) {
|
||||
TAILQ_REMOVE(&thread->timed_pollers, poller, tailq);
|
||||
free(poller);
|
||||
@ -680,10 +684,6 @@ thread_poll(struct spdk_thread *thread, uint32_t max_msgs, uint64_t now)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (now < poller->next_run_tick) {
|
||||
break;
|
||||
}
|
||||
|
||||
poller->state = SPDK_POLLER_STATE_RUNNING;
|
||||
timer_rc = poller->fn(poller->arg);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user