r4515 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Feb 1 09:58:18 CET 2010


Author: phk
Date: 2010-02-01 09:58:17 +0100 (Mon, 01 Feb 2010)
New Revision: 4515

Modified:
   trunk/varnish-cache/bin/varnishd/cache_hash.c
Log:
Explain the oh->refcnt that is lent to sess on waiting list.



Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_hash.c	2010-02-01 08:29:16 UTC (rev 4514)
+++ trunk/varnish-cache/bin/varnishd/cache_hash.c	2010-02-01 08:58:17 UTC (rev 4515)
@@ -330,6 +330,10 @@
 		hsh_testmagic(sp->wrk->nobjhead->digest);
 
 	if (sp->objhead != NULL) {
+		/*
+		 * This sess came off the waiting list, and brings a
+		 * oh refcnt with it.
+		 */
 		CHECK_OBJ_NOTNULL(sp->objhead, OBJHEAD_MAGIC);
 		oh = sp->objhead;
 		sp->objhead = NULL;
@@ -390,10 +394,6 @@
 	 * XXX: this until the object is unbusy'ed, so in practice we
 	 * XXX: serialize fetch of all Vary's if grace is possible.
 	 */
-	/* Grace-stuff: sp->objhead is evaluated in healthy() for 'saint
-	 * mode'. Is this entirely wrong, or just ugly? Why isn't objhead
-	 * set here? FIXME:Grace.
-	 */
 	if (oc == NULL			/* We found no live object */
 	    && grace_oc != NULL		/* There is a grace candidate */
 	    && (busy_oc != NULL		/* Somebody else is already busy */
@@ -429,6 +429,11 @@
 			WSP(sp, SLT_Debug,
 				"on waiting list <%p>", oh);
 		SES_Charge(sp);
+		/*
+		 * The objhead reference transfers to the sess, we get it
+		 * back when the sess comes off the waiting list and
+		 * calls us again
+		 */
 		sp->objhead = oh;
 		sp->wrk = NULL;
 		Lck_Unlock(&oh->mtx);



More information about the varnish-commit mailing list