r3179 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Fri Sep 12 09:25:51 CEST 2008


Author: phk
Date: 2008-09-12 09:25:51 +0200 (Fri, 12 Sep 2008)
New Revision: 3179

Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_center.c
   trunk/varnish-cache/bin/varnishd/cache_expire.c
Log:
Use the obj->entered timestamp when inserting into the expiry structures.



Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2008-09-10 19:11:11 UTC (rev 3178)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2008-09-12 07:25:51 UTC (rev 3179)
@@ -435,7 +435,7 @@
 #define ASSERT_CLI() do {assert(pthread_self() == cli_thread);} while (0)
 
 /* cache_expiry.c */
-void EXP_Insert(struct object *o, double now);
+void EXP_Insert(struct object *o);
 void EXP_Init(void);
 void EXP_Rearm(const struct object *o);
 void EXP_Touch(const struct object *o, double now);

Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2008-09-10 19:11:11 UTC (rev 3178)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2008-09-12 07:25:51 UTC (rev 3179)
@@ -434,8 +434,7 @@
 	sp->obj->cacheable = 1;
 	if (sp->obj->objhead != NULL) {
 		VRY_Create(sp);
-		assert(!isnan(sp->wrk->used));
-		EXP_Insert(sp->obj, sp->wrk->used);
+		EXP_Insert(sp->obj);
 		HSH_Unbusy(sp);
 	}
 	sp->wrk->acct.fetch++;

Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_expire.c	2008-09-10 19:11:11 UTC (rev 3178)
+++ trunk/varnish-cache/bin/varnishd/cache_expire.c	2008-09-12 07:25:51 UTC (rev 3179)
@@ -162,7 +162,7 @@
  */
 
 void
-EXP_Insert(struct object *o, double now)
+EXP_Insert(struct object *o)
 {
 	struct objexp *oe;
 
@@ -173,7 +173,8 @@
 	add_objexp(o);
 	oe = o->objexp;
 
-	oe->lru_stamp = now;
+	assert(o->entered != 0 && !isnan(o->entered));
+	oe->lru_stamp = o->entered;
 	update_object_when(o);
 	LOCK(&exp_mtx);
 	binheap_insert(exp_heap, oe);




More information about the varnish-commit mailing list