Spdk/include/spdk_internal
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
..
accel_engine.h lib/accel: add RPC to select which accel module should be used 2020-02-18 08:05:34 +00:00
assert.h include: Move the remainder of the code base to stdinc.h 2017-05-08 13:20:36 -07:00
event.h lib/event: Support SPDK_THREAD_OP_RESCHED operation in reactor 2020-02-28 14:37:53 +00:00
log.h iscsi: Dump PDU contents to know what PDU was sent in illegal state 2019-06-07 05:11:00 +00:00
lvolstore.h lvol: add option to change default data erase method 2019-01-23 22:25:37 +00:00
memory.h vhost: move global definitions to common header 2019-11-20 09:33:43 +00:00
mock.h test: Add mocks for sendmsg and recvmsg 2019-11-01 17:56:16 +00:00
nvme_tcp.h nvmf: Add a public nvmf_transport.h 2020-02-12 12:07:04 +00:00
sock.h sock/posix: Zero copy send 2020-01-27 17:42:24 +00:00
thread.h thread: Export spdk_set_thread() 2019-07-15 01:34:41 +00:00
uring.h uring: Add a uring.h file. 2019-12-30 11:45:51 +00:00
utf.h utf.h: remove #include "spdk/json.h" 2018-01-31 14:37:16 -05:00
vhost_user.h vhost_user: add VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD definition 2020-01-13 12:43:16 +00:00
virtio.h virtio: remove VHOST_USER_F_PROTOCOL_FEATURES from virtio.h 2020-01-10 08:45:45 +00:00