r4269 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Fri Oct 2 22:51:03 CEST 2009


Author: phk
Date: 2009-10-02 22:51:02 +0200 (Fri, 02 Oct 2009)
New Revision: 4269

Modified:
   trunk/varnish-cache/bin/varnishd/storage_persistent.c
Log:
Nuke this optimization for now.



Modified: trunk/varnish-cache/bin/varnishd/storage_persistent.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_persistent.c	2009-10-01 11:10:31 UTC (rev 4268)
+++ trunk/varnish-cache/bin/varnishd/storage_persistent.c	2009-10-02 20:51:02 UTC (rev 4269)
@@ -1253,7 +1253,6 @@
 	struct smp_sc *sc;
 	struct storage *ss;
 	struct smp_seg *sg;
-	size_t sz2;
 
 	(void)oc;
 	CAST_OBJ_NOTNULL(sc, st->priv, SMP_SC_MAGIC);
@@ -1262,37 +1261,21 @@
 
 	AN(sg->next_addr);
 
-	/*
-	 * XXX: We do not have a mechanism for deciding which allocations
-	 * XXX: have mandatory size and which can be chopped into smaller
-	 * XXX: allocations.
-	 * XXX: The primary unchoppable allocation is from HSH_NewObject()
-	 * XXX: which needs an object + workspace.
-	 */
-	sz2 = sizeof (struct object) + 1024;
-	if (size < sz2)
-		sz2 = size;
-
 	/* If the segment is full, get a new one right away */
-	if (sg->next_addr + sizeof *ss + sz2 + sc->objreserv >
+	if (sg->next_addr + sizeof *ss + size + sc->objreserv >
 	     sg->offset + sg->length) {
 		smp_close_seg(sc, sc->cur_seg);
 		smp_new_seg(sc);
 		sg = sc->cur_seg;
 	}
 
-	assert (sg->next_addr + sizeof *ss + sz2 + sc->objreserv <=
+	assert (sg->next_addr + sizeof *ss + size + sc->objreserv <=
 	    sg->offset + sg->length);
 
-	if (sg->next_addr + sizeof *ss + size + sc->objreserv >
-	    sg->offset + sg->length)
-		size = (sg->offset + sg->length) -
-			(sg->next_addr + sizeof *ss + sc->objreserv);
-
 	ss = (void *)(sc->ptr + sg->next_addr);
 
 	sg->next_addr += size + sizeof *ss;
-	assert(sg->next_addr <= sg->offset + sg->length);
+	assert(sg->next_addr + sc->objreserv <= sg->offset + sg->length);
 	memcpy(sc->ptr + sg->next_addr, "HERE", 4);
 	if (oc != NULL) {
 		CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);



More information about the varnish-commit mailing list