Reduce thread stack size

This patch reduces the stack size required by fio threads and hence allows
to run fio with 200 or more threads on systems with a moderate amount of
virtual memory.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
diff --git a/fio.c b/fio.c
index 896f797..6ab0f4a 100644
--- a/fio.c
+++ b/fio.c
@@ -1380,9 +1380,13 @@
 
 static int fio_start_gtod_thread(void)
 {
+	pthread_attr_t attr;
 	int ret;
 
-	ret = pthread_create(&gtod_thread, NULL, gtod_thread_main, NULL);
+	pthread_attr_init(&attr);
+	pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN);
+	ret = pthread_create(&gtod_thread, &attr, gtod_thread_main, NULL);
+	pthread_attr_destroy(&attr);
 	if (ret) {
 		log_err("Can't create gtod thread: %s\n", strerror(ret));
 		return 1;