[master] cd2ce96 Allocate the vbo and http's out of the backend workspace to avoid wasting partial pages with likely parameter values.

Poul-Henning Kamp phk at varnish-cache.org
Thu Feb 9 08:48:37 CET 2012


commit cd2ce96c4d4d6300fb44d526cf2fc0cc9a39db43
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Feb 9 07:48:04 2012 +0000

    Allocate the vbo and http's out of the backend workspace to avoid
    wasting partial pages with likely parameter values.

diff --git a/bin/varnishd/cache/cache_busyobj.c b/bin/varnishd/cache/cache_busyobj.c
index 65791e8..d6074a7 100644
--- a/bin/varnishd/cache/cache_busyobj.c
+++ b/bin/varnishd/cache/cache_busyobj.c
@@ -40,8 +40,6 @@
 
 static struct mempool		*vbopool;
 
-static volatile unsigned	vbosize;
-
 struct vbo {
 	unsigned		magic;
 #define VBO_MAGIC		0xde3d8223
@@ -51,27 +49,6 @@ struct vbo {
 	struct busyobj		bo;
 };
 
-static struct lock vbo_mtx;
-
-/*--------------------------------------------------------------------
- */
-
-static void
-vbo_size_calc(volatile unsigned *u)
-{
-	uint16_t nhttp;
-	ssize_t http_space;
-
-	assert(cache_param->http_max_hdr < 65536);
-	nhttp = (uint16_t)cache_param->http_max_hdr;
-
-	http_space = HTTP_estimate(nhttp);
-
-	*u = sizeof(struct vbo) +
-	    http_space * 2L +
-	    cache_param->workspace_backend;
-}
-
 /*--------------------------------------------------------------------
  */
 
@@ -79,10 +56,9 @@ void
 VBO_Init(void)
 {
 
-	vbopool = MPL_New("vbo", &cache_param->vbo_pool, &vbosize,
-	    vbo_size_calc);
+	vbopool = MPL_New("vbo", &cache_param->vbo_pool,
+	    &cache_param->workspace_backend, NULL);
 	AN(vbopool);
-	Lck_New(&vbo_mtx, lck_busyobj);
 }
 
 /*--------------------------------------------------------------------



More information about the varnish-commit mailing list