[experimental-ims] b8e04e6 Don't have mempool->free police the max parameter, leave that to the guard. This makes 'max' parameter mis-sizing much less problematic.

Poul-Henning Kamp phk at FreeBSD.org
Thu Dec 18 10:27:43 CET 2014


commit b8e04e61410068ea69e5e291fabec233747072b0
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sun Apr 22 20:05:22 2012 +0000

    Don't have mempool->free police the max parameter, leave that to
    the guard.  This makes 'max' parameter mis-sizing much less problematic.
    
    Spotted by:	scoof

diff --git a/bin/varnishd/cache/cache_mempool.c b/bin/varnishd/cache/cache_mempool.c
index 8906406..badb621 100644
--- a/bin/varnishd/cache/cache_mempool.c
+++ b/bin/varnishd/cache/cache_mempool.c
@@ -329,9 +329,6 @@ MPL_Free(struct mempool *mpl, void *item)
 	if (mi->size < *mpl->cur_size) {
 		mpl->vsc->toosmall++;
 		VTAILQ_INSERT_HEAD(&mpl->surplus, mi, list);
-	} else if (mpl->n_pool >= mpl->param->max_pool) {
-		mpl->vsc->surplus++;
-		VTAILQ_INSERT_HEAD(&mpl->surplus, mi, list);
 	} else {
 		mpl->vsc->pool = ++mpl->n_pool;
 		mi->touched = mpl->t_now;



More information about the varnish-commit mailing list