MINOR: queue: update proxy->served once out of the loop

It's not needed during all these operations and doesn't even affect
queueing in the LB algo, so we can safely update it out of the loop
and the lock.
This commit is contained in:
Willy Tarreau 2021-06-18 18:58:07 +02:00
parent 5304669e1b
commit 3e92a31783

View File

@ -351,10 +351,9 @@ void process_srv_queue(struct server *s, int server_locked)
if (!pc)
break;
done = 1;
done++;
_HA_ATOMIC_INC(&s->served);
_HA_ATOMIC_INC(&p->served);
stream_add_srv_conn(pc->strm, s);
task_wakeup(pc->strm->task, TASK_WOKEN_RES);
@ -363,6 +362,8 @@ void process_srv_queue(struct server *s, int server_locked)
if (!server_locked)
HA_SPIN_UNLOCK(SERVER_LOCK, &s->lock);
_HA_ATOMIC_ADD(&p->served, done);
if (done && p->lbprm.server_take_conn)
p->lbprm.server_take_conn(s, server_locked);
}