projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make lockmem a per job option
[fio.git]
/
backend.c
diff --git
a/backend.c
b/backend.c
index e65af5258af564e64594c65bcbe32f01bb6d9f35..ad9231330547dc39278dd40d1ed94c37d0e2455e 100644
(file)
--- a/
backend.c
+++ b/
backend.c
@@
-56,13
+56,13
@@
static struct flist_head *cgroup_list;
static char *cgroup_mnt;
static int exit_value;
static volatile int fio_abort;
static char *cgroup_mnt;
static int exit_value;
static volatile int fio_abort;
+static unsigned int nr_process = 0;
+static unsigned int nr_thread = 0;
struct io_log *agg_io_log[2];
int groupid = 0;
unsigned int thread_number = 0;
struct io_log *agg_io_log[2];
int groupid = 0;
unsigned int thread_number = 0;
-unsigned int nr_process = 0;
-unsigned int nr_thread = 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;
@@
-335,8
+335,8
@@
static int break_on_this_error(struct thread_data *td, enum fio_ddir ddir,
return 1;
if (td_non_fatal_error(err)) {
return 1;
if (td_non_fatal_error(err)) {
- /*
- * Continue with the I/Os in case of
+ /*
+ * Continue with the I/Os in case of
* a non fatal error.
*/
update_error_count(td, err);
* a non fatal error.
*/
update_error_count(td, err);
@@
-998,6
+998,7
@@
static void *thread_main(void *data)
* eating a file descriptor
*/
fio_mutex_remove(td->mutex);
* eating a file descriptor
*/
fio_mutex_remove(td->mutex);
+ td->mutex = NULL;
/*
* A new gid requires privilege, so we need to do this before setting
/*
* A new gid requires privilege, so we need to do this before setting
@@
-1028,6
+1029,9
@@
static void *thread_main(void *data)
goto err;
}
goto err;
}
+ if (fio_pin_memory(td))
+ goto err;
+
/*
* May alter parameters that init_io_u() will use, so we need to
* do this first.
/*
* May alter parameters that init_io_u() will use, so we need to
* do this first.
@@
-1079,6
+1083,8
@@
static void *thread_main(void *data)
goto err;
}
goto err;
}
+ fio_verify_init(td);
+
fio_gettime(&td->epoch, NULL);
getrusage(RUSAGE_SELF, &td->ru_start);
fio_gettime(&td->epoch, NULL);
getrusage(RUSAGE_SELF, &td->ru_start);
@@
-1090,9
+1096,9
@@
static void *thread_main(void *data)
memcpy(&td->tv_cache, &td->start, sizeof(td->start));
if (td->o.ratemin[0] || td->o.ratemin[1]) {
memcpy(&td->tv_cache, &td->start, sizeof(td->start));
if (td->o.ratemin[0] || td->o.ratemin[1]) {
- memcpy(&td->lastrate[0], &td->bw_sample_time,
+ memcpy(&td->lastrate[0], &td->bw_sample_time,
sizeof(td->bw_sample_time));
sizeof(td->bw_sample_time));
- memcpy(&td->lastrate[1], &td->bw_sample_time,
+ memcpy(&td->lastrate[1], &td->bw_sample_time,
sizeof(td->bw_sample_time));
}
sizeof(td->bw_sample_time));
}
@@
-1141,6
+1147,8
@@
static void *thread_main(void *data)
td->ts.io_bytes[0] = td->io_bytes[0];
td->ts.io_bytes[1] = td->io_bytes[1];
td->ts.io_bytes[0] = td->io_bytes[0];
td->ts.io_bytes[1] = td->io_bytes[1];
+ fio_unpin_memory(td);
+
fio_mutex_down(writeout_mutex);
if (td->bw_log) {
if (td->o.bw_log_file) {
fio_mutex_down(writeout_mutex);
if (td->bw_log) {
if (td->o.bw_log_file) {
@@
-1351,14
+1359,19
@@
static void run_threads(void)
unsigned long spent;
unsigned int i, todo, nr_running, m_rate, t_rate, nr_started;
unsigned long spent;
unsigned int i, todo, nr_running, m_rate, t_rate, nr_started;
- if (fio_pin_memory())
- return;
-
if (fio_gtod_offload && fio_start_gtod_thread())
return;
set_sig_handlers();
if (fio_gtod_offload && fio_start_gtod_thread())
return;
set_sig_handlers();
+ nr_thread = nr_process = 0;
+ for_each_td(td, i) {
+ if (td->o.use_thread)
+ nr_thread++;
+ else
+ nr_process++;
+ }
+
if (!terse_output) {
log_info("Starting ");
if (nr_thread)
if (!terse_output) {
log_info("Starting ");
if (nr_thread)
@@
-1568,7
+1581,6
@@
static void run_threads(void)
}
update_io_ticks();
}
update_io_ticks();
- fio_unpin_memory();
}
static void *disk_thread_main(void *data)
}
static void *disk_thread_main(void *data)