mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
MINOR: haproxy: process signals before runnable tasks
Nowadays signals cause tasks to be woken up. The historic code still processes signals after tasks, which forces a second round in the loop before they can effectively be processed. Let's move the signal queue handling between wake_expired_tasks() and process_runnable_tasks() where it makes much more sense.
This commit is contained in:
parent
54067e9d38
commit
a7ad4aed60
@ -2889,13 +2889,15 @@ void run_poll_loop()
|
|||||||
while (1) {
|
while (1) {
|
||||||
wake_expired_tasks();
|
wake_expired_tasks();
|
||||||
|
|
||||||
/* Process a few tasks */
|
|
||||||
process_runnable_tasks();
|
|
||||||
|
|
||||||
/* check if we caught some signals and process them in the
|
/* check if we caught some signals and process them in the
|
||||||
first thread */
|
first thread */
|
||||||
if (tid == 0)
|
if (signal_queue_len && tid == 0) {
|
||||||
|
activity[tid].wake_signal++;
|
||||||
signal_process_queue();
|
signal_process_queue();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Process a few tasks */
|
||||||
|
process_runnable_tasks();
|
||||||
|
|
||||||
/* also stop if we failed to cleanly stop all tasks */
|
/* also stop if we failed to cleanly stop all tasks */
|
||||||
if (killed > 1)
|
if (killed > 1)
|
||||||
@ -2905,8 +2907,6 @@ void run_poll_loop()
|
|||||||
wake = 1;
|
wake = 1;
|
||||||
if (thread_has_tasks())
|
if (thread_has_tasks())
|
||||||
activity[tid].wake_tasks++;
|
activity[tid].wake_tasks++;
|
||||||
else if (signal_queue_len && tid == 0)
|
|
||||||
activity[tid].wake_signal++;
|
|
||||||
else {
|
else {
|
||||||
_HA_ATOMIC_OR(&sleeping_thread_mask, tid_bit);
|
_HA_ATOMIC_OR(&sleeping_thread_mask, tid_bit);
|
||||||
__ha_barrier_atomic_store();
|
__ha_barrier_atomic_store();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user