[experimental-ims] fc387c3 Eliminate the mempool poll function again, we don't need it anyway.

Geoff Simmons geoff at varnish-cache.org
Tue Feb 14 17:49:28 CET 2012


commit fc387c38ed38ddf3748f26b558a3c2e3589921b4
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Feb 9 07:51:52 2012 +0000

    Eliminate the mempool poll function again, we don't need it anyway.

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 8df9591..e376b66 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -889,15 +889,13 @@ int Lck_CondWait(pthread_cond_t *cond, struct lock *lck, struct timespec *ts);
 #undef LOCK
 
 /* cache_mempool.c */
-typedef void mpl_poll_f(volatile unsigned *);
 void MPL_AssertSane(void *item);
 struct mempool * MPL_New(const char *name, volatile struct poolparam *pp,
-    volatile unsigned *cur_size, mpl_poll_f *poll_f);
+    volatile unsigned *cur_size);
 void MPL_Destroy(struct mempool **mpp);
 void *MPL_Get(struct mempool *mpl, unsigned *size);
 void MPL_Free(struct mempool *mpl, void *item);
 
-
 /* cache_panic.c */
 void PAN_Init(void);
 
diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index 2610b06..b683300 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -519,6 +519,6 @@ void
 VDI_Init(void)
 {
 
-	vbcpool = MPL_New("vbc", &cache_param->vbc_pool, &vbcps, NULL);
+	vbcpool = MPL_New("vbc", &cache_param->vbc_pool, &vbcps);
 	AN(vbcpool);
 }
diff --git a/bin/varnishd/cache/cache_busyobj.c b/bin/varnishd/cache/cache_busyobj.c
index d6074a7..3a60bfd 100644
--- a/bin/varnishd/cache/cache_busyobj.c
+++ b/bin/varnishd/cache/cache_busyobj.c
@@ -57,7 +57,7 @@ VBO_Init(void)
 {
 
 	vbopool = MPL_New("vbo", &cache_param->vbo_pool,
-	    &cache_param->workspace_backend, NULL);
+	    &cache_param->workspace_backend);
 	AN(vbopool);
 }
 
diff --git a/bin/varnishd/cache/cache_mempool.c b/bin/varnishd/cache/cache_mempool.c
index 4b8ed07..8906406 100644
--- a/bin/varnishd/cache/cache_mempool.c
+++ b/bin/varnishd/cache/cache_mempool.c
@@ -57,7 +57,6 @@ struct mempool {
 	struct lock			mtx;
 	volatile struct poolparam	*param;
 	volatile unsigned		*cur_size;
-	mpl_poll_f			*poll_func;
 	uint64_t			live;
 	struct VSC_C_mempool		*vsc;
 	unsigned			n_pool;
@@ -105,8 +104,6 @@ mpl_guard(void *priv)
 	mpl_slp = 0.15;	// random
 	while (1) {
 		VTIM_sleep(mpl_slp);
-		if (mpl->poll_func != NULL)
-			mpl->poll_func(mpl->cur_size);
 		mpl_slp = 0.814;	// random
 		mpl->t_now = VTIM_real();
 
@@ -226,8 +223,7 @@ mpl_guard(void *priv)
 
 struct mempool *
 MPL_New(const char *name,
-	volatile struct poolparam *pp,
-	volatile unsigned *cur_size, mpl_poll_f *poll_f)
+    volatile struct poolparam *pp, volatile unsigned *cur_size)
 {
 	struct mempool *mpl;
 
@@ -236,9 +232,6 @@ MPL_New(const char *name,
 	bprintf(mpl->name, "%s", name);
 	mpl->param = pp;
 	mpl->cur_size = cur_size;
-	mpl->poll_func = poll_f;
-	if (poll_f != NULL)
-		poll_f(mpl->cur_size);
 	VTAILQ_INIT(&mpl->list);
 	VTAILQ_INIT(&mpl->surplus);
 	Lck_New(&mpl->mtx, lck_mempool);
diff --git a/bin/varnishd/cache/cache_session.c b/bin/varnishd/cache/cache_session.c
index 58ff960..07b5cfb 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -383,9 +383,9 @@ SES_NewPool(struct pool *wp, unsigned pool_no)
 	pp->pool = wp;
 	bprintf(nb, "req%u", pool_no);
 	pp->mpl_req = MPL_New(nb, &cache_param->req_pool,
-	    &cache_param->workspace_client, NULL);
+	    &cache_param->workspace_client);
 	bprintf(nb, "sess%u", pool_no);
-	pp->mpl_sess = MPL_New(nb, &cache_param->sess_pool, &ses_size, NULL);
+	pp->mpl_sess = MPL_New(nb, &cache_param->sess_pool, &ses_size);
 	return (pp);
 }
 



More information about the varnish-commit mailing list