[master] 0b31b9f Make sure the thread_pool_stack default is at least the minimum imposed by the kernel.

Poul-Henning Kamp phk at FreeBSD.org
Wed Apr 2 15:54:10 CEST 2014


commit 0b31b9f091afa34b97d1c18bfc7b185afa1be11f
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Apr 2 13:53:39 2014 +0000

    Make sure the thread_pool_stack default is at least the minimum
    imposed by the kernel.
    
    Spotted by:	ingvar (on PPC64)

diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index 7da3d88..5dc602e 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -340,11 +340,12 @@ make_secret(const char *dirname)
 /*--------------------------------------------------------------------*/
 
 static char stackmin[20];
+static char stackdef[20];
 
 static void
 init_params(struct cli *cli)
 {
-	ssize_t low;
+	ssize_t def, low;
 
 	MCF_CollectParams();
 
@@ -372,6 +373,12 @@ init_params(struct cli *cli)
 	bprintf(stackmin, "%jd", (intmax_t)low);
 	MCF_SetMinimum("thread_pool_stack", stackmin);
 
+	def = 48 * 1024;
+	if (def < low)
+		def = low;
+	bprintf(stackdef, "%jd", (intmax_t)def);
+	MCF_SetDefault("thread_pool_stack", stackdef);
+
 	MCF_InitParams(cli);
 }
 
diff --git a/bin/varnishd/mgt/mgt_pool.c b/bin/varnishd/mgt/mgt_pool.c
index c3fd066..b3294f7 100644
--- a/bin/varnishd/mgt/mgt_pool.c
+++ b/bin/varnishd/mgt/mgt_pool.c
@@ -214,6 +214,6 @@ struct parspec WRK_parspec[] = {
 		"This will likely be rounded up to a multiple of 4k"
 		" (or whatever the page_size might be) by the kernel.",
 		EXPERIMENTAL,
-		"48k", "bytes" },
+		NULL, "bytes" },	// default set in mgt_main.c
 	{ NULL, NULL, NULL }
 };



More information about the varnish-commit mailing list