[master] afe89d5 Reduce contention on the wstat_mtx marginally while we figure out what the real solution is going to be.

Poul-Henning Kamp phk at FreeBSD.org
Tue May 20 09:12:34 CEST 2014


commit afe89d5520114dc297a3d3c4cec3c4373fefadf3
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue May 20 07:11:57 2014 +0000

    Reduce contention on the wstat_mtx marginally while we figure out
    what the real solution is going to be.

diff --git a/bin/varnishd/cache/cache_wrk.c b/bin/varnishd/cache/cache_wrk.c
index 6496a3a..7f9d410 100644
--- a/bin/varnishd/cache/cache_wrk.c
+++ b/bin/varnishd/cache/cache_wrk.c
@@ -54,7 +54,6 @@ wrk_sumstat(struct worker *w)
 #undef VSC_F
 #undef L0
 #undef L1
-	memset(&w->stats, 0, sizeof w->stats);
 }
 
 void
@@ -64,6 +63,7 @@ WRK_SumStat(struct worker *w)
 	Lck_Lock(&wstat_mtx);
 	wrk_sumstat(w);
 	Lck_Unlock(&wstat_mtx);
+	memset(&w->stats, 0, sizeof w->stats);
 }
 
 int
@@ -73,6 +73,7 @@ WRK_TrySumStat(struct worker *w)
 		return (0);
 	wrk_sumstat(w);
 	Lck_Unlock(&wstat_mtx);
+	memset(&w->stats, 0, sizeof w->stats);
 	return (1);
 }
 



More information about the varnish-commit mailing list