r3840 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Sat Feb 28 18:20:20 CET 2009


Author: phk
Date: 2009-02-28 18:20:19 +0100 (Sat, 28 Feb 2009)
New Revision: 3840

Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_hash.c
Log:
Eliminate the parent-child linkage between objects involved in grace.

The original thinking was that only objects being prefetched were
relevant, but we take a more expansive view now.



Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2009-02-27 16:09:03 UTC (rev 3839)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2009-02-28 17:20:19 UTC (rev 3840)
@@ -330,10 +330,6 @@
 
 	double			last_use;
 
-	/* Prefetch */
-	struct object		*parent;
-	struct object		*child;
-
 	int			hits;
 };
 

Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_hash.c	2009-02-27 16:09:03 UTC (rev 3839)
+++ trunk/varnish-cache/bin/varnishd/cache_hash.c	2009-02-28 17:20:19 UTC (rev 3840)
@@ -330,11 +330,11 @@
 		AN(o);
 
 	/*
-	 * If we have a object in grace and being fetched,
+	 * If we have seen a busy object, and have an object in grace,
 	 * use it, if req.grace is also satisified.
 	 */
 	if (o == NULL && grace_o != NULL &&
-	    grace_o->child != NULL &&
+	    busy_o != NULL &&
 	    grace_o->ttl + HSH_Grace(sp->grace) >= sp->t_req)
 		o = grace_o;
 
@@ -374,11 +374,6 @@
 	/* XXX: Should this not be ..._HEAD now ? */
 	VTAILQ_INSERT_TAIL(&oh->objcs, oc, list);
 	/* NB: do not deref objhead the new object inherits our reference */
-	if (grace_o != NULL) {
-		grace_o->child = o;
-		o->parent = grace_o;
-		grace_o->refcnt++;
-	}
 	Lck_Unlock(&oh->mtx);
 	/*
 	 * XXX: This may be too early, relative to pass objects.
@@ -432,7 +427,6 @@
 {
 	struct object *o;
 	struct objhead *oh;
-	struct object *parent;
 
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
 	o = sp->obj;
@@ -453,14 +447,8 @@
 	o->objcore->flags &= ~OC_F_BUSY;
 	if (oh != NULL)
 		hsh_rush(oh);
-	parent = o->parent;
-	o->parent = NULL;
-	if (parent != NULL)
-		parent->child = NULL;
 	if (oh != NULL)
 		Lck_Unlock(&oh->mtx);
-	if (parent != NULL)
-		HSH_Deref(sp->wrk, &parent);
 }
 
 void



More information about the varnish-commit mailing list