diff options
author | Jens Axboe <axboe@suse.de> | 2005-12-06 21:32:39 +0100 |
---|---|---|
committer | Jens Axboe <axboe@suse.de> | 2005-12-06 21:32:39 +0100 |
commit | 2572cf2ab8d86803882fa52802b091702512777f (patch) | |
tree | ea8a95fcef7b97826725a2f9c2fdcea167b8a6b4 | |
parent | be067bcec0b42ec067e94d42a5039cbe2ce7eeb1 (diff) |
[PATCH] fio: misc fixes
- Only use threads for > 1 thread
- Don't clear ->iodepth for SYNCIO def_thread
- Only use setsid() for forked threads
-rw-r--r-- | fio-ini.c | 14 | ||||
-rw-r--r-- | fio-io.c | 4 | ||||
-rw-r--r-- | fio.c | 6 |
3 files changed, 15 insertions, 9 deletions
@@ -160,13 +160,6 @@ static int add_job(struct thread_data *td, const char *jobname, int prioclass, struct stat sb; int numjobs; - if (td->io_engine & FIO_SYNCIO) - td->iodepth = 1; - else { - if (!td->iodepth) - td->iodepth = 1; - } - #ifndef FIO_HAVE_LIBAIO if (td->io_engine == FIO_LIBAIO) { fprintf(stderr, "Linux libaio not available\n"); @@ -189,6 +182,13 @@ static int add_job(struct thread_data *td, const char *jobname, int prioclass, if (td == &def_thread) return 0; + if (td->io_engine & FIO_SYNCIO) + td->iodepth = 1; + else { + if (!td->iodepth) + td->iodepth = 1; + } + td->filetype = FIO_TYPE_FILE; if (!stat(jobname, &sb) && S_ISBLK(sb.st_mode)) td->filetype = FIO_TYPE_BD; @@ -4,6 +4,10 @@ * * sync io is implemented on top of aio. * + * This is not really specific to fio, if the get_io_u/put_io_u and + * structures was pulled into this as well it would be a perfectly + * generic io engine that could be used for other projects. + * */ #include <stdio.h> #include <stdlib.h> @@ -1605,7 +1605,9 @@ static void *thread_main(void *data) struct thread_data *td = data; int ret = 1; - setsid(); + if (!td->use_thread) + setsid(); + td->pid = getpid(); if (init_io_u(td)) @@ -1858,7 +1860,7 @@ static void run_threads(void) unsigned long spent; int i, todo, nr_running, m_rate, t_rate, nr_started; - printf("Starting %d threads\n", thread_number); + printf("Starting %d thread%s\n", thread_number, thread_number > 1 ? "s" : ""); fflush(stdout); signal(SIGINT, sig_handler); |