reactor: do not switch mode for threads in non interrupt tgt

Fixes #2693

spdk threads should not be placed in interrupt mode
if the application does not have interrupt mode enabled.

This resulted in race condition, while reactor was placed
in interrupt mode, thread was scheduled on it.
Such operation is a valid one, but never should be attempt
to change the threads mode in this case.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I10b0bbacac1df812badb91b37064528f66743e51
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14815
Reviewed-by: Michal Berger <michal.berger@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Tomasz Zawadzki 2022-09-30 16:44:55 +02:00
parent c34f15e09c
commit f98ac63ea7

View File

@ -364,10 +364,12 @@ _reactor_set_interrupt_mode(void *arg1, void *arg2)
target->in_interrupt = target->new_in_interrupt;
/* Align spdk_thread with reactor to interrupt mode or poll mode */
TAILQ_FOREACH_SAFE(lw_thread, &target->threads, link, tmp) {
thread = spdk_thread_get_from_ctx(lw_thread);
spdk_thread_send_msg(thread, _reactor_set_thread_interrupt_mode, target);
if (spdk_interrupt_mode_is_enabled()) {
/* Align spdk_thread with reactor to interrupt mode or poll mode */
TAILQ_FOREACH_SAFE(lw_thread, &target->threads, link, tmp) {
thread = spdk_thread_get_from_ctx(lw_thread);
spdk_thread_send_msg(thread, _reactor_set_thread_interrupt_mode, target);
}
}
if (target->new_in_interrupt == false) {