r4583 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Feb 22 22:12:53 CET 2010


Author: phk
Date: 2010-02-22 22:12:53 +0100 (Mon, 22 Feb 2010)
New Revision: 4583

Modified:
   trunk/varnish-cache/bin/varnishd/mgt_pool.c
   trunk/varnish-cache/bin/varnishd/varnishd.c
Log:
Respect PTHREAD_STACK_MIN for workerthread stack size.



Modified: trunk/varnish-cache/bin/varnishd/mgt_pool.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_pool.c	2010-02-21 22:00:09 UTC (rev 4582)
+++ trunk/varnish-cache/bin/varnishd/mgt_pool.c	2010-02-22 21:12:53 UTC (rev 4583)
@@ -191,10 +191,11 @@
 		EXPERIMENTAL,
 		"3", "requests per request" },
 	{ "thread_pool_stack",
-		tweak_uint, &master.wthread_stacksize, 64*1024, UINT_MAX,
-		"Worker thread stack size.  In particular on 32bit systems "
-		"you may need to tweak this down to fit many threads into "
-		"the limited address space.\n",
+		tweak_uint, &master.wthread_stacksize,
+		PTHREAD_STACK_MIN, UINT_MAX,
+		"Worker thread stack size.\n"
+		"On 32bit systems you may need to tweak this down to fit "
+		"many threads into the limited address space.\n",
 		EXPERIMENTAL,
 		"-1", "bytes" },
 	{ NULL, NULL, NULL }

Modified: trunk/varnish-cache/bin/varnishd/varnishd.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/varnishd.c	2010-02-21 22:00:09 UTC (rev 4582)
+++ trunk/varnish-cache/bin/varnishd/varnishd.c	2010-02-22 21:12:53 UTC (rev 4583)
@@ -587,7 +587,11 @@
 		 */
 		MCF_ParamSet(cli, "sess_workspace", "16384");
 		cli_check(cli);
-		MCF_ParamSet(cli, "thread_pool_stack", "65536");
+
+		/* Set the stacksize to min(PTHREAD_STACK_MIN, 64k) */
+		bprintf(dirname, "%d",
+		    PTHREAD_STACK_MIN > 65536 ? PTHREAD_STACK_MIN : 65536);
+		MCF_ParamSet(cli, "thread_pool_stack", dirname);
 		cli_check(cli);
 	}
 



More information about the varnish-commit mailing list