numam-spdk/lib/event
Jim Harris c4f086b6ed event: use for_each_reactor to shut down reactors
There could be an outstanding for_each_reactor operation
in progress when the application shuts down.  If we don't
wait for that operation to complete, we'll get a memory
leak for its context.

So when stopping the reactors, before setting the
state to EXITING, do one final for_each_reactor to
ensure any outstanding for_each_reactor operations are
flushed.  Once this final for_each_reactor operation
is complete, we can set the state to EXITING safely.

Also use a global mutex and flag to ensure no more
for_each_reactor operations can start while the final
for_each_reactor is in progress.  If a new operation
is requested, we'll just ignore since the reactors are
shutting down anyways.

Fixes issue #2206.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6d86eb3b0c7855e98481ab4164af82e76c009618

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9928
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-10-21 09:17:42 +00:00
..
app_rpc.c scheduler: create public API and subsystem for scheduler/governor 2021-09-07 07:33:03 +00:00
app.c event: add disable_signal_handlers to the spdk_app_opts struct 2021-09-15 07:11:42 +00:00
log_rpc.c log_rpc: Unify codes in end path. 2021-05-05 13:26:06 +00:00
Makefile event: add disable_signal_handlers to the spdk_app_opts struct 2021-09-15 07:11:42 +00:00
reactor.c event: use for_each_reactor to shut down reactors 2021-10-21 09:17:42 +00:00
scheduler_static.c scheduler: create public API and subsystem for scheduler/governor 2021-09-07 07:33:03 +00:00
spdk_event.map scheduler: create public API and subsystem for scheduler/governor 2021-09-07 07:33:03 +00:00