[master] e954c73d1 param: Promote mempools in the parameters table

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Wed Oct 21 13:51:07 UTC 2020


commit e954c73d12e1092c9263ece25e60eae236f7934b
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Wed Oct 21 15:44:31 2020 +0200

    param: Promote mempools in the parameters table
    
    We had everything we needed to make this happen, except for the mismatch
    between parameter names pool_xxx and struct member names xxx_pool.
    
    Refs #3250

diff --git a/bin/varnishd/cache/cache_busyobj.c b/bin/varnishd/cache/cache_busyobj.c
index d80bd1ecc..5e07ccd46 100644
--- a/bin/varnishd/cache/cache_busyobj.c
+++ b/bin/varnishd/cache/cache_busyobj.c
@@ -49,7 +49,7 @@ void
 VBO_Init(void)
 {
 
-	vbopool = MPL_New("busyobj", &cache_param->vbo_pool,
+	vbopool = MPL_New("busyobj", &cache_param->pool_vbo,
 	    &cache_param->workspace_backend);
 	AN(vbopool);
 }
diff --git a/bin/varnishd/cache/cache_session.c b/bin/varnishd/cache/cache_session.c
index fa6ab0b96..f927538fd 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -630,10 +630,10 @@ SES_NewPool(struct pool *pp, unsigned pool_no)
 
 	CHECK_OBJ_NOTNULL(pp, POOL_MAGIC);
 	bprintf(nb, "req%u", pool_no);
-	pp->mpl_req = MPL_New(nb, &cache_param->req_pool,
+	pp->mpl_req = MPL_New(nb, &cache_param->pool_req,
 	    &cache_param->workspace_client);
 	bprintf(nb, "sess%u", pool_no);
-	pp->mpl_sess = MPL_New(nb, &cache_param->sess_pool,
+	pp->mpl_sess = MPL_New(nb, &cache_param->pool_sess,
 	    &cache_param->workspace_session);
 
 	pp->waiter = Waiter_New();
diff --git a/bin/varnishd/common/common_param.h b/bin/varnishd/common/common_param.h
index 5896bde0a..ed8ccf8a4 100644
--- a/bin/varnishd/common/common_param.h
+++ b/bin/varnishd/common/common_param.h
@@ -115,10 +115,6 @@ struct params {
 
 	struct vre_limits	vre_limits;
 
-	struct poolparam	req_pool;
-	struct poolparam	sess_pool;
-	struct poolparam	vbo_pool;
-
 	uint8_t			vsl_mask[256>>3];
 	uint8_t			debug_bits[(DBG_Reserved+7)>>3];
 	uint8_t			feature_bits[(FEATURE_Reserved+7)>>3];
diff --git a/bin/varnishd/mgt/mgt_param_tbl.c b/bin/varnishd/mgt/mgt_param_tbl.c
index fec7493a9..869fdedcd 100644
--- a/bin/varnishd/mgt/mgt_param_tbl.c
+++ b/bin/varnishd/mgt/mgt_param_tbl.c
@@ -38,12 +38,6 @@
 #include "mgt/mgt_param.h"
 
 
-#define MEMPOOL_TEXT							\
-	"The three numbers are:\n"					\
-	"\tmin_pool\tminimum size of free pool.\n"			\
-	"\tmax_pool\tmaximum size of free pool.\n"			\
-	"\tmax_age\tmax age of free element."
-
 struct parspec mgt_parspec[] = {
 #define PARAM(nm, ty, ...) { #nm, tweak_##ty, &mgt_param.nm, __VA_ARGS__ },
 #include "tbl/params.h"
@@ -122,21 +116,6 @@ struct parspec mgt_parspec[] = {
 		"Matching failures will show up in the log as VCL_Error"
 		" messages with regexp errors -27 or -21.\n\n"
 		"Testcase r01576 can be useful when tuning this parameter." },
-	{ "pool_req", tweak_poolparam, &mgt_param.req_pool,
-		NULL, NULL, "10,100,10",
-		NULL,
-		"Parameters for per worker pool request memory pool.\n\n"
-		MEMPOOL_TEXT },
-	{ "pool_sess", tweak_poolparam, &mgt_param.sess_pool,
-		NULL, NULL, "10,100,10",
-		NULL,
-		"Parameters for per worker pool session memory pool.\n\n"
-		MEMPOOL_TEXT },
-	{ "pool_vbo", tweak_poolparam, &mgt_param.vbo_pool,
-		NULL, NULL, "10,100,10",
-		NULL,
-		"Parameters for backend object fetch memory pool.\n\n"
-		MEMPOOL_TEXT },
 
 	{ NULL, NULL, NULL }
 };
diff --git a/include/tbl/params.h b/include/tbl/params.h
index b67c3c0dc..23874857b 100644
--- a/include/tbl/params.h
+++ b/include/tbl/params.h
@@ -1209,6 +1209,50 @@ PARAM(
 	"HTTP2 maximum size of an uncompressed header list."
 )
 
+#define MEMPOOL_TEXT							\
+	"The three numbers are:\n"					\
+	"\tmin_pool\tminimum size of free pool.\n"			\
+	"\tmax_pool\tmaximum size of free pool.\n"			\
+	"\tmax_age\tmax age of free element."
+
+PARAM(
+	/* name */	pool_req,
+	/* type */	poolparam,
+	/* min */	NULL,
+	/* max */	NULL,
+	/* def */	"10,100,10",
+	/* units */	NULL,
+	/* descr */
+	"Parameters for per worker pool request memory pool.\n"
+	MEMPOOL_TEXT
+)
+
+PARAM(
+	/* name */	pool_sess,
+	/* type */	poolparam,
+	/* min */	NULL,
+	/* max */	NULL,
+	/* def */	"10,100,10",
+	/* units */	NULL,
+	/* descr */
+	"Parameters for per worker pool session memory pool.\n"
+	MEMPOOL_TEXT
+)
+
+PARAM(
+	/* name */	pool_vbo,
+	/* type */	poolparam,
+	/* min */	NULL,
+	/* max */	NULL,
+	/* def */	"10,100,10",
+	/* units */	NULL,
+	/* descr */
+	"Parameters for backend object fetch memory pool.\n"
+	MEMPOOL_TEXT
+)
+
+#undef MEMPOOL_TEXT
+
 #if 0 /* NOT ACTUALLY DEFINED HERE */
 /* actual location mgt_param_bits.c*/
 /* see tbl/debug_bits.h */
@@ -1286,45 +1330,6 @@ PARAM(
 	"recursions in a pcre_exec() execution."
 )
 
-/* actual location mgt_param_tbl.c */
-PARAM(
-	/* name */	pool_req,
-	/* type */	poolparam,
-	/* min */	NULL,
-	/* max */	NULL,
-	/* def */	"10,100,10",
-	/* units */	NULL,
-	/* descr */
-	"Parameters for per worker pool request memory pool.\n"
-	MEMPOOL_TEXT
-)
-
-/* actual location mgt_param_tbl.c */
-PARAM(
-	/* name */	pool_sess,
-	/* type */	poolparam,
-	/* min */	NULL,
-	/* max */	NULL,
-	/* def */	"10,100,10",
-	/* units */	NULL,
-	/* descr */
-	"Parameters for per worker pool session memory pool.\n"
-	MEMPOOL_TEXT
-)
-
-/* actual location mgt_param_tbl.c */
-PARAM(
-	/* name */	pool_vbo,
-	/* type */	poolparam,
-	/* min */	NULL,
-	/* max */	NULL,
-	/* def */	"10,100,10",
-	/* units */	NULL,
-	/* descr */
-	"Parameters for backend object fetch memory pool.\n"
-	MEMPOOL_TEXT
-)
-
 /* actual location mgt_pool.c */
 PARAM(
 	/* name */	thread_pool_add_delay,


More information about the varnish-commit mailing list