[master] bc13919d5 avoid holding the ban_mtx unless we need to

Nils Goroll nils.goroll at uplex.de
Wed Sep 26 06:39:12 UTC 2018


commit bc13919d58aac92203bd4bcb431878adde96f7e6
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Wed Sep 26 08:21:37 2018 +0200

    avoid holding the ban_mtx unless we need to

diff --git a/bin/varnishd/cache/cache_ban_lurker.c b/bin/varnishd/cache/cache_ban_lurker.c
index defe55d91..1729e04a9 100644
--- a/bin/varnishd/cache/cache_ban_lurker.c
+++ b/bin/varnishd/cache/cache_ban_lurker.c
@@ -229,6 +229,11 @@ ban_lurker_test_ban(struct worker *wrk, struct vsl_log *vsl, struct ban *bt,
 		}
 		oc = ban_lurker_getfirst(vsl, bt);
 		if (oc == NULL) {
+			if (tested == 0 && lokc == 0) {
+				AZ(tested_tests);
+				AZ(lok);
+				return;
+			}
 			Lck_Lock(&ban_mtx);
 			VSC_C_main->bans_lurker_tested += tested;
 			VSC_C_main->bans_lurker_tests_tested += tested_tests;


More information about the varnish-commit mailing list