MEDIUM: proxy: Use the new _HA_ATOMIC_* macros.

Use the new _HA_ATOMIC_* macros and add barriers where needed.
This commit is contained in:
Olivier Houchard 2019-03-08 18:48:16 +01:00 committed by Olivier Houchard
parent d5f9b19196
commit 11ecfd1c01
1 changed files with 6 additions and 6 deletions

View File

@ -121,9 +121,9 @@ static inline void proxy_reset_timeouts(struct proxy *proxy)
/* increase the number of cumulated connections received on the designated frontend */
static void inline proxy_inc_fe_conn_ctr(struct listener *l, struct proxy *fe)
{
HA_ATOMIC_ADD(&fe->fe_counters.cum_conn, 1);
_HA_ATOMIC_ADD(&fe->fe_counters.cum_conn, 1);
if (l->counters)
HA_ATOMIC_ADD(&l->counters->cum_conn, 1);
_HA_ATOMIC_ADD(&l->counters->cum_conn, 1);
HA_ATOMIC_UPDATE_MAX(&fe->fe_counters.cps_max,
update_freq_ctr(&fe->fe_conn_per_sec, 1));
}
@ -132,9 +132,9 @@ static void inline proxy_inc_fe_conn_ctr(struct listener *l, struct proxy *fe)
static void inline proxy_inc_fe_sess_ctr(struct listener *l, struct proxy *fe)
{
HA_ATOMIC_ADD(&fe->fe_counters.cum_sess, 1);
_HA_ATOMIC_ADD(&fe->fe_counters.cum_sess, 1);
if (l->counters)
HA_ATOMIC_ADD(&l->counters->cum_sess, 1);
_HA_ATOMIC_ADD(&l->counters->cum_sess, 1);
HA_ATOMIC_UPDATE_MAX(&fe->fe_counters.sps_max,
update_freq_ctr(&fe->fe_sess_per_sec, 1));
}
@ -142,7 +142,7 @@ static void inline proxy_inc_fe_sess_ctr(struct listener *l, struct proxy *fe)
/* increase the number of cumulated connections on the designated backend */
static void inline proxy_inc_be_ctr(struct proxy *be)
{
HA_ATOMIC_ADD(&be->be_counters.cum_conn, 1);
_HA_ATOMIC_ADD(&be->be_counters.cum_conn, 1);
HA_ATOMIC_UPDATE_MAX(&be->be_counters.sps_max,
update_freq_ctr(&be->be_sess_per_sec, 1));
}
@ -150,7 +150,7 @@ static void inline proxy_inc_be_ctr(struct proxy *be)
/* increase the number of cumulated requests on the designated frontend */
static void inline proxy_inc_fe_req_ctr(struct proxy *fe)
{
HA_ATOMIC_ADD(&fe->fe_counters.p.http.cum_req, 1);
_HA_ATOMIC_ADD(&fe->fe_counters.p.http.cum_req, 1);
HA_ATOMIC_UPDATE_MAX(&fe->fe_counters.p.http.rps_max,
update_freq_ctr(&fe->fe_req_per_sec, 1));
}