]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream: Remove the lock on the proxy to update time stats
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 8 Nov 2019 13:45:41 +0000 (14:45 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 15 Nov 2019 12:43:08 +0000 (13:43 +0100)
swrate_add() is now thread-safe. So the lock on the proxy is no longer needed to
update q_time, c_time, d_time and t_time.

src/stream.c

index c0c462c0713d37a4720217c8cf2269cf8429666e..58ebab6ab5b9b942feffc5912c0e595a49efd93c 100644 (file)
@@ -2957,12 +2957,10 @@ void stream_update_time_stats(struct stream *s)
                swrate_add(&srv->counters.d_time, TIME_STATS_SAMPLES, t_data);
                swrate_add(&srv->counters.t_time, TIME_STATS_SAMPLES, t_close);
        }
-       HA_SPIN_LOCK(PROXY_LOCK, &s->be->lock);
        swrate_add(&s->be->be_counters.q_time, TIME_STATS_SAMPLES, t_queue);
        swrate_add(&s->be->be_counters.c_time, TIME_STATS_SAMPLES, t_connect);
        swrate_add(&s->be->be_counters.d_time, TIME_STATS_SAMPLES, t_data);
        swrate_add(&s->be->be_counters.t_time, TIME_STATS_SAMPLES, t_close);
-       HA_SPIN_UNLOCK(PROXY_LOCK, &s->be->lock);
 }
 
 /*