Hit this with many threads running.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
INIT_LIST_HEAD(&td->io_log_list);
if (init_io_u(td))
INIT_LIST_HEAD(&td->io_log_list);
if (init_io_u(td))
if (fio_setaffinity(td) == -1) {
td_verror(td, errno, "cpu_set_affinity");
if (fio_setaffinity(td) == -1) {
td_verror(td, errno, "cpu_set_affinity");
if (td->ioprio) {
if (ioprio_set(IOPRIO_WHO_PROCESS, 0, td->ioprio) == -1) {
td_verror(td, errno, "ioprio_set");
if (td->ioprio) {
if (ioprio_set(IOPRIO_WHO_PROCESS, 0, td->ioprio) == -1) {
td_verror(td, errno, "ioprio_set");
}
}
if (nice(td->nice) == -1) {
td_verror(td, errno, "nice");
}
}
if (nice(td->nice) == -1) {
td_verror(td, errno, "nice");
}
if (init_random_state(td))
}
if (init_random_state(td))
if (td->ioscheduler && switch_ioscheduler(td))
if (td->ioscheduler && switch_ioscheduler(td))
td_set_runstate(td, TD_INITIALIZED);
fio_sem_up(startup_sem);
td_set_runstate(td, TD_INITIALIZED);
fio_sem_up(startup_sem);
cleanup_io_u(td);
td_set_runstate(td, TD_EXITED);
return (void *) (unsigned long) td->error;
cleanup_io_u(td);
td_set_runstate(td, TD_EXITED);
return (void *) (unsigned long) td->error;
+err_sem:
+ fio_sem_up(startup_sem);
+ goto err;
blocks = (f->real_file_size + td->rw_min_bs - 1) / td->rw_min_bs;
num_maps = (blocks + BLOCKS_PER_MAP-1)/ BLOCKS_PER_MAP;
f->file_map = malloc(num_maps * sizeof(long));
blocks = (f->real_file_size + td->rw_min_bs - 1) / td->rw_min_bs;
num_maps = (blocks + BLOCKS_PER_MAP-1)/ BLOCKS_PER_MAP;
f->file_map = malloc(num_maps * sizeof(long));
+ if (!f->file_map) {
+ log_err("fio: failed allocating random map. If running a large number of jobs, try the 'norandommap' option\n");
+ return 1;
+ }
f->num_maps = num_maps;
memset(f->file_map, 0, num_maps * sizeof(long));
}
f->num_maps = num_maps;
memset(f->file_map, 0, num_maps * sizeof(long));
}