numam-spdk/lib/event
Shuhei Matsumoto a4335feb6d lib/event: Support SPDK_THREAD_OP_RESCHED operation in reactor
Add a flag resched to check if reschedule operation is requested
to struct spdk_lw_thread. Add _reactor_resquest_thread_reschedule()
to set the resched flag, and add it to the case SPDK_THREAD_OP_RESCHED
in spdk_reactor_thread_op(), and return true in the case
SPDK_THREAD_OP_RESCHED in spdk_reactor_thread_op_supported().

Then _spdk_reactor_run() checks if the resched flag is true for each
thread. If true, set the resched flag to false, and remove the
thread and call _reactor_schedule_thread(). Add continue to avoid
use-after-free issue for both reschedule and terminate cases.

This idea follows voluntary thread termination and will remove our
worries for all complicated rare cases.

Add unit test case to verify this update.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I656872d32dbb469ae70f771cd0419a77236bfe18
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/500
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-02-28 14:37:53 +00:00
..
app.c app: added --json-ignore-init-errors 2020-02-13 09:53:02 +00:00
json_config.c app: added --json-ignore-init-errors 2020-02-13 09:53:02 +00:00
Makefile lib/event: move rpc and subsystems dirs to module 2019-08-22 16:29:49 +00:00
reactor.c lib/event: Support SPDK_THREAD_OP_RESCHED operation in reactor 2020-02-28 14:37:53 +00:00
rpc.c rpc: add spdk_rpc_verify_methods() 2019-11-06 15:19:48 +00:00
subsystem.c lib/event: remove app.c dependency from subsystem initialization 2019-08-28 15:26:12 +00:00