numam-spdk/test/unit/lib
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
..
bdev vbdev/raid: close the base bdev on its opened thread 2020-02-26 09:26:49 +00:00
blob ut/blob: always use local blobstore pointer 2020-02-21 09:35:27 +00:00
blobfs blobfs: write IO directly if it is lba aligned 2020-01-07 12:19:14 +00:00
event lib/event: Support SPDK_THREAD_OP_RESCHED operation in reactor 2020-02-28 14:37:53 +00:00
ftl lib/ftl: Merge ftl_thread structure with ftl_dev 2020-02-28 08:54:07 +00:00
ioat test/unit: remove duplicate mk/spdk.common.mk includes 2019-02-11 09:30:27 +00:00
iscsi lib/iscsi: Remove dry run processing from portal config file parsing 2020-02-17 10:06:47 +00:00
json ut/cunit: added missing semicolon on CU_ASSERT macros 2019-07-24 18:21:22 +00:00
jsonrpc jsonrpc: always allocate response for request 2019-07-19 20:56:54 +00:00
log log: passing user-defined log 2019-06-18 03:56:50 +00:00
lvol ut/lvol: fixed scan-build error on spdk_bs_init 2019-07-01 13:08:33 +00:00
notify lib/notify: rename spdk_notify_get_events to spdk_notify_foreach_event 2019-05-07 06:11:27 +00:00
nvme nvme: export internal security send/receive APIs as public APIs 2020-02-26 09:22:15 +00:00
nvmf test/unit: [nvmf/ctrlr.c] Increase feature get|set coverage 2020-02-27 10:15:40 +00:00
reduce lib/reduce: add array bounds checking for iovs. 2019-12-19 11:04:57 +00:00
scsi lib/scsi: Pass SCSI task to SCSI layer to get DIF context 2019-11-21 08:01:29 +00:00
sock test: solve error about uninitialised data_buf 2020-02-17 10:05:18 +00:00
thread lib/thread: Add spdk_thread_lib_init_ext() and generic thread operation function 2020-02-27 10:14:23 +00:00
util util/base64: Extend b64 decode to calculate exact len 2020-02-03 11:39:49 +00:00
vhost vhost: add a protocol_features parameter in vdev 2019-12-30 11:46:24 +00:00
json_mock.c subsystem: add per module configuration dump 2018-03-23 02:47:40 -04:00
Makefile test/unit: remove vhost dependency from ftl tests 2020-01-15 13:37:19 +00:00