projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
travis: make CI install script bail out on first error
[fio.git]
/
backend.c
diff --git
a/backend.c
b/backend.c
index 936203dcb1c4858b1b3f7ddea23ab5f965e04bb4..0e454cdd1e9a4f2979320e7b913cc5f242d4b362 100644
(file)
--- a/
backend.c
+++ b/
backend.c
@@
-66,7
+66,11
@@
unsigned int stat_number = 0;
int shm_id = 0;
int temp_stall_ts;
unsigned long done_secs = 0;
int shm_id = 0;
int temp_stall_ts;
unsigned long done_secs = 0;
+#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+pthread_mutex_t overlap_check = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
+#else
pthread_mutex_t overlap_check = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t overlap_check = PTHREAD_MUTEX_INITIALIZER;
+#endif
#define JOB_START_TIMEOUT (5 * 1000)
#define JOB_START_TIMEOUT (5 * 1000)
@@
-134,8
+138,8
@@
static bool __check_min_rate(struct thread_data *td, struct timespec *now,
unsigned long long bytes = 0;
unsigned long iops = 0;
unsigned long spent;
unsigned long long bytes = 0;
unsigned long iops = 0;
unsigned long spent;
- unsigned long rate;
- unsigned
int
ratemin = 0;
+ unsigned long
long
rate;
+ unsigned
long long
ratemin = 0;
unsigned int rate_iops = 0;
unsigned int rate_iops_min = 0;
unsigned int rate_iops = 0;
unsigned int rate_iops_min = 0;
@@
-169,7
+173,7
@@
static bool __check_min_rate(struct thread_data *td, struct timespec *now,
* check bandwidth specified rate
*/
if (bytes < td->rate_bytes[ddir]) {
* check bandwidth specified rate
*/
if (bytes < td->rate_bytes[ddir]) {
- log_err("%s: rate_min=%uB/s not met, only transferred %lluB\n",
+ log_err("%s: rate_min=%
ll
uB/s not met, only transferred %lluB\n",
td->o.name, ratemin, bytes);
return true;
} else {
td->o.name, ratemin, bytes);
return true;
} else {
@@
-180,7
+184,7
@@
static bool __check_min_rate(struct thread_data *td, struct timespec *now,
if (rate < ratemin ||
bytes < td->rate_bytes[ddir]) {
if (rate < ratemin ||
bytes < td->rate_bytes[ddir]) {
- log_err("%s: rate_min=%
uB/s not met, got %
luB/s\n",
+ log_err("%s: rate_min=%
lluB/s not met, got %l
luB/s\n",
td->o.name, ratemin, rate);
return true;
}
td->o.name, ratemin, rate);
return true;
}
@@
-201,7
+205,7
@@
static bool __check_min_rate(struct thread_data *td, struct timespec *now,
if (rate < rate_iops_min ||
iops < td->rate_blocks[ddir]) {
if (rate < rate_iops_min ||
iops < td->rate_blocks[ddir]) {
- log_err("%s: rate_iops_min=%u not met, got %lu IOPS\n",
+ log_err("%s: rate_iops_min=%u not met, got %l
l
u IOPS\n",
td->o.name, rate_iops_min, rate);
return true;
}
td->o.name, rate_iops_min, rate);
return true;
}
@@
-237,15
+241,10
@@
static void cleanup_pending_aio(struct thread_data *td)
{
int r;
{
int r;
- if (td->error)
- return;
-
/*
* get immediately available events, if any
*/
r = io_u_queued_complete(td, 0);
/*
* get immediately available events, if any
*/
r = io_u_queued_complete(td, 0);
- if (r < 0)
- return;
/*
* now cancel remaining active events
/*
* now cancel remaining active events
@@
-1011,12
+1010,6
@@
static void do_io(struct thread_data *td, uint64_t *bytes_done)
if (td->o.verify != VERIFY_NONE && io_u->ddir == DDIR_READ &&
((io_u->flags & IO_U_F_VER_LIST) || !td_rw(td))) {
if (td->o.verify != VERIFY_NONE && io_u->ddir == DDIR_READ &&
((io_u->flags & IO_U_F_VER_LIST) || !td_rw(td))) {
- if (!td->o.verify_pattern_bytes) {
- io_u->rand_seed = __rand(&td->verify_state);
- if (sizeof(int) != sizeof(long *))
- io_u->rand_seed *= __rand(&td->verify_state);
- }
-
if (verify_state_should_stop(td, io_u)) {
put_io_u(td, io_u);
break;
if (verify_state_should_stop(td, io_u)) {
put_io_u(td, io_u);
break;
@@
-1546,7
+1539,7
@@
static void *thread_main(void *data)
uint64_t bytes_done[DDIR_RWDIR_CNT];
int deadlock_loop_cnt;
bool clear_state;
uint64_t bytes_done[DDIR_RWDIR_CNT];
int deadlock_loop_cnt;
bool clear_state;
- int ret;
+ int re
s, re
t;
sk_out_assign(sk_out);
free(fd);
sk_out_assign(sk_out);
free(fd);
@@
-1871,11
+1864,15
@@
static void *thread_main(void *data)
* offload mode so that we don't clean up this job while
* another thread is checking its io_u's for overlap
*/
* offload mode so that we don't clean up this job while
* another thread is checking its io_u's for overlap
*/
- if (td_offload_overlap(td))
- pthread_mutex_lock(&overlap_check);
+ if (td_offload_overlap(td)) {
+ int res = pthread_mutex_lock(&overlap_check);
+ assert(res == 0);
+ }
td_set_runstate(td, TD_FINISHING);
td_set_runstate(td, TD_FINISHING);
- if (td_offload_overlap(td))
- pthread_mutex_unlock(&overlap_check);
+ if (td_offload_overlap(td)) {
+ res = pthread_mutex_unlock(&overlap_check);
+ assert(res == 0);
+ }
update_rusage_stat(td);
td->ts.total_run_time = mtime_since_now(&td->epoch);
update_rusage_stat(td);
td->ts.total_run_time = mtime_since_now(&td->epoch);