Lines Matching refs:thread
15 #include "spdk/thread.h"
268 static int reactor_thread_op(struct spdk_thread *thread, enum spdk_thread_op op);
319 SPDK_ERRLOG("Initialize spdk thread lib failed\n");
423 struct spdk_thread *thread;
438 thread = spdk_thread_get_from_ctx(lw_thread);
440 grp = spdk_thread_get_interrupt_fd_group(thread);
443 grp = spdk_thread_get_interrupt_fd_group(thread);
447 spdk_thread_send_msg(thread, _reactor_set_thread_interrupt_mode, target);
674 * strictly thread safe. However, we're toggling between true and
675 * false here, and if a thread sees the value update later than it
701 struct spdk_thread *thread = spdk_thread_get_from_ctx(lw_thread);
707 spdk_set_thread(thread);
719 struct spdk_thread *thread;
721 thread = spdk_thread_get_by_id(thread_info->thread_id);
722 if (thread == NULL) {
726 lw_thread = spdk_thread_get_ctx(thread);
746 SPDK_ERRLOG("A thread cannot be moved from an isolated core or \
747 moved to an isolated core. Skip rescheduling thread\n");
824 /* Phase 1 of thread scheduling is to gather metrics on the existing threads */
830 struct spdk_thread *thread;
867 thread = spdk_thread_get_from_ctx(lw_thread);
868 assert(thread != NULL);
869 core_info->thread_infos[i].thread_id = spdk_thread_get_id(thread);
875 spdk_trace_record(TRACE_SCHEDULER_THREAD_STATS, spdk_thread_get_trace_id(thread), 0, 0,
888 /* If we've looped back around to the scheduler thread, move to the next phase */
898 static int _reactor_schedule_thread(struct spdk_thread *thread);
904 struct spdk_thread *thread = spdk_thread_get_from_ctx(lw_thread);
911 /* Operate thread intr if running with full interrupt ability */
914 grp = spdk_thread_get_interrupt_fd_group(thread);
923 struct spdk_thread *thread = spdk_thread_get_from_ctx(lw_thread);
925 if (spdk_unlikely(spdk_thread_is_exited(thread) &&
926 spdk_thread_is_idle(thread))) {
928 spdk_thread_destroy(thread);
932 if (spdk_unlikely(lw_thread->resched && !spdk_thread_is_bound(thread))) {
935 _reactor_schedule_thread(thread);
953 struct spdk_thread *thread;
962 * thread execution time correctly. */
971 thread = spdk_thread_get_from_ctx(lw_thread);
972 rc = spdk_thread_poll(thread, 0, reactor->tsc_last);
974 now = spdk_thread_get_last_tsc(thread);
990 struct spdk_thread *thread;
997 /* Rename the POSIX thread because the reactor is tied to the POSIX
998 * thread in the SPDK event library.
1038 thread = spdk_thread_get_from_ctx(lw_thread);
1040 * for the app thread.
1042 if (spdk_thread_is_running(thread)) {
1043 if (!spdk_thread_is_app_thread(thread)) {
1044 SPDK_ERRLOG("spdk_thread_exit() was not called on thread '%s'\n",
1045 spdk_thread_get_name(thread));
1048 spdk_set_thread(thread);
1049 spdk_thread_exit(thread);
1055 thread = spdk_thread_get_from_ctx(lw_thread);
1056 spdk_set_thread(thread);
1057 if (spdk_thread_is_exited(thread)) {
1059 spdk_thread_destroy(thread);
1064 spdk_thread_poll(thread, 0, 0);
1118 SPDK_ERRLOG("Unable to start reactor thread on core %u\n", reactor->lcore);
1183 struct spdk_thread *thread;
1192 /* Update total_stats to reflect state of thread
1194 thread = spdk_thread_get_from_ctx(lw_thread);
1195 spdk_set_thread(thread);
1207 /* Operate thread intr if running with full interrupt ability */
1212 grp = spdk_thread_get_interrupt_fd_group(thread);
1220 spdk_thread_send_msg(thread, _reactor_set_thread_interrupt_mode, reactor);
1225 _reactor_schedule_thread(struct spdk_thread *thread)
1237 cpumask = spdk_thread_get_cpumask(thread);
1239 lw_thread = spdk_thread_get_ctx(thread);
1252 * reactor runs on DPDK thread, skip reactors which are in interrupt mode.
1265 spdk_cpuset_and(&valid_cpumask, spdk_thread_get_cpumask(thread));
1304 spdk_trace_record(TRACE_SCHEDULER_MOVE_THREAD, spdk_thread_get_trace_id(thread), 0, 0,
1312 SPDK_ERRLOG("Unable to schedule thread on requested core mask.\n");
1324 _reactor_request_thread_reschedule(struct spdk_thread *thread)
1330 assert(thread == spdk_get_thread());
1332 lw_thread = spdk_thread_get_ctx(thread);
1353 reactor_thread_op(struct spdk_thread *thread, enum spdk_thread_op op)
1359 lw_thread = spdk_thread_get_ctx(thread);
1362 return _reactor_schedule_thread(thread);
1364 _reactor_request_thread_reschedule(thread);