__tasklet_wakeup_here(tl);
}
-/* schedules tasklet <tl> to run onto thread <thr> or the current thread if
- * <thr> is negative. Note that it is illegal to wakeup a foreign tasklet if
- * its tid is negative and it is illegal to self-assign a tasklet that was
- * at least once scheduled on a specific thread. With DEBUG_TASK, the
- * <file>:<line> from the call place are stored into the tasklet for tracing
- * purposes.
+/* schedules tasklet <tl> to run onto thread <thr> which must be valid. With
+ * DEBUG_TASK, the <file>:<line> from the call place are stored into the
+ * tasklet for tracing purposes.
*
* The macro accepts an optional 3rd argument that is passed as a set of flags
* to be set on the tasklet, among TASK_WOKEN_*, TASK_F_UEVT* etc to indicate a
/* Do not call this one, please use tasklet_wakeup_on() instead, as this one is
* the slow path of tasklet_wakeup_on() which performs some preliminary checks
- * and sets TASK_QUEUED before calling this one. A negative <thr> designates
- * the current thread.
+ * and sets TASK_QUEUED before calling this one.
*/
void __tasklet_wakeup_on(struct tasklet *tl, int thr)
{
- if (likely(thr < 0)) {
- /* this tasklet runs on the caller thread */
- if (_HA_ATOMIC_LOAD(&th_ctx->flags) & TH_FL_TASK_PROFILING)
- tl->wake_date = now_mono_time();
+ BUG_ON_HOT(thr < 0);
- if (tl->state & TASK_HEAVY) {
- LIST_APPEND(&th_ctx->tasklets[TL_HEAVY], &tl->list);
- th_ctx->tl_class_mask |= 1 << TL_HEAVY;
- }
- else if (tl->state & TASK_SELF_WAKING) {
- LIST_APPEND(&th_ctx->tasklets[TL_BULK], &tl->list);
- th_ctx->tl_class_mask |= 1 << TL_BULK;
- }
- else if ((struct task *)tl == th_ctx->current && !(tl->state & TASK_WOKEN_ANY)) {
- LIST_APPEND(&th_ctx->tasklets[TL_BULK], &tl->list);
- th_ctx->tl_class_mask |= 1 << TL_BULK;
- }
- else if (th_ctx->current_queue < 0) {
- LIST_APPEND(&th_ctx->tasklets[TL_URGENT], &tl->list);
- th_ctx->tl_class_mask |= 1 << TL_URGENT;
- }
- else {
- LIST_APPEND(&th_ctx->tasklets[TL_NORMAL], &tl->list);
- th_ctx->tl_class_mask |= 1 << TL_NORMAL;
- }
- _HA_ATOMIC_INC(&th_ctx->rq_total);
- } else {
- /* this tasklet runs on a specific thread. */
- if (_HA_ATOMIC_LOAD(&ha_thread_ctx[thr].flags) & TH_FL_TASK_PROFILING)
- tl->wake_date = now_mono_time();
+ if (_HA_ATOMIC_LOAD(&ha_thread_ctx[thr].flags) & TH_FL_TASK_PROFILING)
+ tl->wake_date = now_mono_time();
- MT_LIST_APPEND(&ha_thread_ctx[thr].shared_tasklet_list, list_to_mt_list(&tl->list));
- _HA_ATOMIC_INC(&ha_thread_ctx[thr].rq_total);
- wake_thread(thr);
- }
+ MT_LIST_APPEND(&ha_thread_ctx[thr].shared_tasklet_list, list_to_mt_list(&tl->list));
+ _HA_ATOMIC_INC(&ha_thread_ctx[thr].rq_total);
+ wake_thread(thr);
}
/* Do not call this one, please use tasklet_wakeup_after_on() instead, as this one is