projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] Get rid of FIO_INST_PREFIX
[fio.git]
/
fio.c
diff --git
a/fio.c
b/fio.c
index 0221ca5b959440952783ffcd7fb98e957e9d02d8..42ac0c9b0d7dd0904b90bfd2451c4681ac42b48a 100644
(file)
--- a/
fio.c
+++ b/
fio.c
@@
-45,7
+45,6
@@
int groupid = 0;
int thread_number = 0;
int shm_id = 0;
int temp_stall_ts;
int thread_number = 0;
int shm_id = 0;
int temp_stall_ts;
-const char *fio_inst_prefix = _INST_PREFIX;
static volatile int startup_sem;
static volatile int startup_sem;
@@
-452,7
+451,7
@@
static void do_io(struct thread_data *td)
usec_sleep(td, td->thinktime);
}
usec_sleep(td, td->thinktime);
}
- if (!
ret
) {
+ if (!
td->error
) {
if (td->cur_depth)
cleanup_pending_aio(td);
if (td->cur_depth)
cleanup_pending_aio(td);
@@
-656,6
+655,8
@@
static void *thread_main(void *data)
if (!td->create_serialize && setup_files(td))
goto err;
if (!td->create_serialize && setup_files(td))
goto err;
+ if (open_files(td))
+ goto err;
gettimeofday(&td->epoch, NULL);
gettimeofday(&td->epoch, NULL);
@@
-751,12
+752,12
@@
static void *fork_main(int shmid, int offset)
static void reap_threads(int *nr_running, int *t_rate, int *m_rate)
{
struct thread_data *td;
static void reap_threads(int *nr_running, int *t_rate, int *m_rate)
{
struct thread_data *td;
- int i, cputhreads;
+ int i, cputhreads
, pending
;
/*
* reap exited threads (TD_EXITED -> TD_REAPED)
*/
/*
* reap exited threads (TD_EXITED -> TD_REAPED)
*/
- cputhreads = 0;
+
pending =
cputhreads = 0;
for_each_td(td, i) {
/*
* ->io_ops is NULL for a thread that has closed its
for_each_td(td, i) {
/*
* ->io_ops is NULL for a thread that has closed its
@@
-765,8
+766,12
@@
static void reap_threads(int *nr_running, int *t_rate, int *m_rate)
if (td->io_ops && td->io_ops->flags & FIO_CPUIO)
cputhreads++;
if (td->io_ops && td->io_ops->flags & FIO_CPUIO)
cputhreads++;
- if (td->runstate != TD_EXITED)
+ if (td->runstate != TD_EXITED) {
+ if (td->runstate < TD_RUNNING)
+ pending++;
+
continue;
continue;
+ }
td_set_runstate(td, TD_REAPED);
td_set_runstate(td, TD_REAPED);
@@
-783,7
+788,7
@@
static void reap_threads(int *nr_running, int *t_rate, int *m_rate)
(*t_rate) -= td->rate;
}
(*t_rate) -= td->rate;
}
- if (*nr_running == cputhreads)
+ if (*nr_running == cputhreads
&& !pending
)
terminate_threads(TERMINATE_ALL);
}
terminate_threads(TERMINATE_ALL);
}