MINOR: task: limit the remote thread wakeup to the global runqueue only

The test in __task_wakeup() to figure if the remote threads are sleeping
doesn't make sense outside of the global runqueue test, since there are
only two possibilities here: local runqueue or global runqueue, hence a
sleeping thread is another one and can only happen when sending to the
global run queue. Let's move the test inside the "if" block.
This commit is contained in:
Willy Tarreau 2021-02-24 16:44:51 +01:00
parent 018564eaa2
commit eeffb3df41

View File

@ -153,7 +153,6 @@ void __task_wakeup(struct task *t)
if (root == &rqueue) { if (root == &rqueue) {
_HA_ATOMIC_OR(&t->state, TASK_GLOBAL); _HA_ATOMIC_OR(&t->state, TASK_GLOBAL);
HA_SPIN_UNLOCK(TASK_RQ_LOCK, &rq_lock); HA_SPIN_UNLOCK(TASK_RQ_LOCK, &rq_lock);
}
/* If all threads that are supposed to handle this task are sleeping, /* If all threads that are supposed to handle this task are sleeping,
* wake one. * wake one.
@ -166,6 +165,7 @@ void __task_wakeup(struct task *t)
_HA_ATOMIC_AND(&sleeping_thread_mask, ~m); _HA_ATOMIC_AND(&sleeping_thread_mask, ~m);
wake_thread(my_ffsl(m) - 1); wake_thread(my_ffsl(m) - 1);
} }
}
#endif #endif
return; return;
} }