Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Commits

[master] 353073c Make VSC->hcb_nolock a worker local counter for consistency, locking it would seriously miss the point.

 

 

Varnish commits RSS feed   Index | Next | Previous | View Threaded


phk at varnish-cache

Apr 23, 2012, 1:00 AM

Post #1 of 1 (41 views)
Permalink
[master] 353073c Make VSC->hcb_nolock a worker local counter for consistency, locking it would seriously miss the point.

commit 353073cf26dc461fdc0e5f11e40fdebc34c0c763
Author: Poul-Henning Kamp <phk [at] FreeBSD>
Date: Mon Apr 23 08:00:01 2012 +0000

Make VSC->hcb_nolock a worker local counter for consistency, locking
it would seriously miss the point.

Spotted by: scoof

diff --git a/bin/varnishd/hash/hash_critbit.c b/bin/varnishd/hash/hash_critbit.c
index 08be561..46f7f95 100644
--- a/bin/varnishd/hash/hash_critbit.c
+++ b/bin/varnishd/hash/hash_critbit.c
@@ -432,7 +432,7 @@ hcb_lookup(struct worker *wrk, const void *digest, struct objhead **noh)

/* First try in read-only mode without holding a lock */

- VSC_C_main->hcb_nolock++;
+ wrk->stats.hcb_nolock++;
oh = hcb_insert(wrk, &hcb_root, digest, NULL);
if (oh != NULL) {
Lck_Lock(&oh->mtx);
diff --git a/include/tbl/vsc_f_main.h b/include/tbl/vsc_f_main.h
index 2938d7a..bc79d5b 100644
--- a/include/tbl/vsc_f_main.h
+++ b/include/tbl/vsc_f_main.h
@@ -454,7 +454,7 @@ VSC_F(bans_dups, uint64_t, 0, 'c',

/**********************************************************************/

-VSC_F(hcb_nolock, uint64_t, 0, 'a',
+VSC_F(hcb_nolock, uint64_t, 1, 'a',
"HCB Lookups without lock",
""
)

_______________________________________________
varnish-commit mailing list
varnish-commit [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit

Varnish commits RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.