Skip to contentSkip to conversation

libxenstore: Use PTHREAD_STACK_MIN

PATCH New Ian Campbell 2 participants 2 messages Oct 25, 2013 – Oct 28, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxenstore: Use PTHREAD_STACK_MIN

From: Ian Campbell <[email protected]>

The existing value of 16K is smaller than the arm64 minimum stack size, which is 128K. PTHREAD_STACK_MIN appears to be standard
http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_setstacksize.html

Consindered setting a lower bound but the stack requirements of the watcher thread are pretty minimal (tens of bytes from the looks of it) and unlikely to blow PTHREAD_STACK_MIN on any useful platform.

---
 tools/xenstore/xs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/xenstore/xs.c +1 -1
index b1e6820..261b841 100644
@@ -723,7 +723,7 @@ bool xs_watch(struct xs_handle *h, const char *path, const char *token)
 	struct iovec iov[2];
 
 #ifdef USE_PTHREAD
-#define READ_THREAD_STACKSIZE (16 * 1024)
+#define READ_THREAD_STACKSIZE PTHREAD_STACK_MIN
 
 	/* We dynamically create a reader thread on demand. */
 	mutex_lock(&h->request_mutex);
Signature · 1 line
1.8.4.rc3
#1 lore raw

PATCH 1/1 libxenstore: Use PTHREAD_STACK_MIN

Ian Campbell writes ("[PATCH] libxenstore: Use PTHREAD_STACK_MIN"):

Quoted 11 lines

From: Ian Campbell <[email protected]>

The existing value of 16K is smaller than the arm64 minimum stack size, which is 128K. PTHREAD_STACK_MIN appears to be standard
http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_setstacksize.html

Consindered setting a lower bound but the stack requirements of the watcher thread are pretty minimal (tens of bytes from the looks of it) and unlikely to blow PTHREAD_STACK_MIN on any useful platform.