Commit f98ac63e authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

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: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I10b0bbacac1df812badb91b37064528f66743e51
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14815


Reviewed-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent c34f15e0
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -364,11 +364,13 @@ _reactor_set_interrupt_mode(void *arg1, void *arg2)

	target->in_interrupt = target->new_in_interrupt;

	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) {
		/* Reactor is no longer in interrupt mode. Refresh the tsc_last to accurately