; Keep adding 1024kb/s reading clients at 4 seconds
[/tmp/file1]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=0
[/tmp/file2]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=4
[/tmp/file3]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=8
[/tmp/file4]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=12
[/tmp/file5]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=16
[/tmp/file6]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=20
[/tmp/file7]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=24
[/tmp/file8]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=28
[/tmp/file9]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=32
[/tmp/file10]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=36
[/tmp/file11]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=40
[/tmp/file12]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=44
[/tmp/file13]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=48
[/tmp/file14]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=52
[/tmp/file15]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=56
[/tmp/file16]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=60
[/tmp/file17]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=64
[/tmp/file18]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=68
[/tmp/file19]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=72
[/tmp/file20]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=76
[/tmp/file21]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=80
[/tmp/file22]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=84
[/tmp/file23]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=88
[/tmp/file24]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=92
[/tmp/file25]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=96
[/tmp/file26]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=100
[/tmp/file27]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=104
[/tmp/file28]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=108
[/tmp/file29]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=112
[/tmp/file30]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=116
[/tmp/file31]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=120
[/tmp/file32]
-rw=0
+rw=read
rate=1250
ratemin=1024
startdelay=124
; Read 4 files with aio at different depths
[global]
-aio
-random
-rw=0
+ioengine=libaio
+rw=randread
bs=128k
[/data1/file1]
-aio_depth=4
+iodepth=4
[/data1/file2]
-aio_depth=32
+iodepth=32
[/data1/file3]
-aio_depth=8
+iodepth=8
[/data1/file4]
-aio_depth=16
+iodepth=16
numjobs=4 ; 4 simultaneous threads for each job
[f1]
-sequential
-rw=1
+rw=write
[f2]
stonewall
-random
-rw=1
+rw=randwrite
[f3]
stonewall
-sequential
-rw=0
+rw=read
[f4]
stonewall
-random
-rw=0
+rw=randread
#define DEF_RATE_CYCLE (1000)
#define DEF_ODIRECT (1)
#define DEF_IO_ENGINE (FIO_SYNCIO)
+#define DEF_IO_ENGINE_NAME "sync"
#define DEF_SEQUENTIAL (1)
#define DEF_RAND_REPEAT (1)
#define DEF_OVERWRITE (1)
td->rate = parent->rate;
td->ratemin = parent->ratemin;
td->ratecycle = parent->ratecycle;
- td->aio_depth = parent->aio_depth;
+ td->iodepth = parent->iodepth;
td->sync_io = parent->sync_io;
td->mem_type = parent->mem_type;
td->bw_avg_time = parent->bw_avg_time;
td->numjobs = parent->numjobs;
td->use_thread = parent->use_thread;
memcpy(&td->cpumask, &parent->cpumask, sizeof(td->cpumask));
+ strcpy(td->io_engine_name, parent->io_engine_name);
return td;
}
run_str[td->thread_number - 1] = 'P';
if ((td->io_engine & FIO_SYNCIO) == 0) {
- if (!td->aio_depth)
- td->aio_depth = 1;
+ if (!td->iodepth)
+ td->iodepth = 1;
}
if (td->min_bs == -1U)
if (write_bw_log)
setup_log(&td->bw_log);
- printf("Client%d (g=%d): rw=%d, prio=%d/%d, seq=%d, odir=%d, bs=%d-%d, rate=%d, ioengine=%d, aio_depth=%d\n", td->thread_number, td->groupid, td->ddir, prioclass, prio, td->sequential, td->odirect, td->min_bs, td->max_bs, td->rate, td->io_engine, td->aio_depth);
+ printf("Client%d (g=%d): rw=%d, prio=%d/%d, seq=%d, odir=%d, bs=%d-%d, rate=%d, ioengine=%s, iodepth=%d\n", td->thread_number, td->groupid, td->ddir, prioclass, prio, td->sequential, td->odirect, td->min_bs, td->max_bs, td->rate, td->io_engine_name, td->iodepth);
/*
* recurse add identical jobs, clear numjobs and stonewall options
static int str_ioengine_cb(struct thread_data *td, char *str)
{
if (!strncmp(str, "linuxaio", 8) || !strncmp(str, "aio", 3)) {
+ strcpy(td->io_engine_name, "libaio");
td->io_engine = FIO_LIBAIO;
return 0;
} else if (!strncmp(str, "posixaio", 8)) {
+ strcpy(td->io_engine_name, "posixaio");
td->io_engine = FIO_POSIXAIO;
return 0;
} else if (!strncmp(str, "sync", 4)) {
+ strcpy(td->io_engine_name, "sync");
td->io_engine = FIO_SYNCIO;
return 0;
} else if (!strncmp(str, "mmap", 4)) {
+ strcpy(td->io_engine_name, "mmap");
td->io_engine = FIO_MMAPIO;
return 0;
}
fgetpos(f, &off);
continue;
}
- if (!check_int(p, "iodepth", &td->aio_depth)) {
+ if (!check_int(p, "iodepth", &td->iodepth)) {
fgetpos(f, &off);
continue;
}
def_thread.min_bs = -1;
def_thread.max_bs = -1;
def_thread.io_engine = DEF_IO_ENGINE;
+ strcpy(def_thread.io_engine_name, DEF_IO_ENGINE_NAME);
def_thread.odirect = DEF_ODIRECT;
def_thread.ratecycle = DEF_RATE_CYCLE;
def_thread.sequential = DEF_SEQUENTIAL;
static struct io_u *fio_libaio_event(struct thread_data *td, int event)
{
- struct libaio_data *ld = td->aio_data;
+ struct libaio_data *ld = td->io_data;
return ev_to_iou(ld->aio_events + event);
}
static int fio_libaio_getevents(struct thread_data *td, int min, int max,
struct timespec *t)
{
- struct libaio_data *ld = td->aio_data;
+ struct libaio_data *ld = td->io_data;
int r;
static int fio_libaio_queue(struct thread_data *td, struct io_u *io_u)
{
- struct libaio_data *ld = td->aio_data;
+ struct libaio_data *ld = td->io_data;
struct iocb *iocb = &io_u->iocb;
int ret;
static int fio_libaio_cancel(struct thread_data *td, struct io_u *io_u)
{
- struct libaio_data *ld = td->aio_data;
+ struct libaio_data *ld = td->io_data;
return io_cancel(ld->aio_ctx, &io_u->iocb, ld->aio_events);
}
static void fio_libaio_cleanup(struct thread_data *td)
{
- struct libaio_data *ld = td->aio_data;
+ struct libaio_data *ld = td->io_data;
if (ld) {
io_destroy(ld->aio_ctx);
free(ld->aio_events);
free(ld);
- td->aio_data = NULL;
+ td->io_data = NULL;
}
}
struct libaio_data *ld = malloc(sizeof(*ld));
memset(ld, 0, sizeof(*ld));
- if (io_queue_init(td->aio_depth, &ld->aio_ctx)) {
+ if (io_queue_init(td->iodepth, &ld->aio_ctx)) {
td_verror(td, errno);
return 1;
}
td->io_cleanup = fio_libaio_cleanup;
td->io_sync = fio_io_sync;
- ld->aio_events = malloc(td->aio_depth * sizeof(struct io_event));
- td->aio_data = ld;
+ ld->aio_events = malloc(td->iodepth * sizeof(struct io_event));
+ td->io_data = ld;
return 0;
}
static int fio_posixaio_getevents(struct thread_data *td, int min, int max,
struct timespec *t)
{
- struct posixaio_data *pd = td->aio_data;
+ struct posixaio_data *pd = td->io_data;
struct list_head *entry;
int r;
static struct io_u *fio_posixaio_event(struct thread_data *td, int event)
{
- struct posixaio_data *pd = td->aio_data;
+ struct posixaio_data *pd = td->io_data;
return pd->aio_events[event];
}
static void fio_posixaio_cleanup(struct thread_data *td)
{
- struct posixaio_data *pd = td->aio_data;
+ struct posixaio_data *pd = td->io_data;
if (pd) {
free(pd->aio_events);
free(pd);
- td->aio_data = NULL;
+ td->io_data = NULL;
}
}
{
struct posixaio_data *pd = malloc(sizeof(*pd));
- pd->aio_events = malloc(td->aio_depth * sizeof(struct io_u *));
+ pd->aio_events = malloc(td->iodepth * sizeof(struct io_u *));
td->io_prep = fio_posixaio_prep;
td->io_queue = fio_posixaio_queue;
td->io_cleanup = fio_posixaio_cleanup;
td->io_sync = fio_io_sync;
- td->aio_data = pd;
+ td->io_data = pd;
return 0;
}
static struct io_u *fio_syncio_event(struct thread_data *td, int event)
{
- struct syncio_data *sd = td->aio_data;
+ struct syncio_data *sd = td->io_data;
return sd->last_io_u;
}
static int fio_syncio_queue(struct thread_data *td, struct io_u *io_u)
{
- struct syncio_data *sd = td->aio_data;
+ struct syncio_data *sd = td->io_data;
int ret;
if (io_u->ddir == DDIR_READ)
static void fio_syncio_cleanup(struct thread_data *td)
{
- free(td->aio_data);
- td->aio_data = NULL;
+ if (td->io_data) {
+ free(td->io_data);
+ td->io_data = NULL;
+ }
}
int fio_syncio_init(struct thread_data *td)
td->io_sync = fio_io_sync;
sd->last_io_u = NULL;
- td->aio_data = sd;
+ td->io_data = sd;
return 0;
}
static int fio_mmapio_queue(struct thread_data *td, struct io_u *io_u)
{
unsigned long long real_off = io_u->offset - td->file_offset;
- struct syncio_data *sd = td->aio_data;
+ struct syncio_data *sd = td->io_data;
if (io_u->ddir == DDIR_READ)
memcpy(io_u->buf, td->mmap + real_off, io_u->buflen);
td->io_sync = fio_mmapio_sync;
sd->last_io_u = NULL;
- td->aio_data = sd;
+ td->io_data = sd;
return 0;
}
{
unsigned char *p = (unsigned char *) io_u->buf;
unsigned long c;
+ int ret;
p += sizeof(*hdr);
c = crc32(p, hdr->len - sizeof(*hdr));
+ ret = c != hdr->crc32;
- return c != hdr->crc32;
+ if (ret) {
+ fprintf(stderr, "crc32: verify failed at %llu/%u\n", io_u->offset, io_u->buflen);
+ fprintf(stderr, "crc32: wanted %lx, got %lx\n", hdr->crc32, c);
+ }
+
+ return ret;
}
static int verify_io_u_md5(struct verify_header *hdr, struct io_u *io_u)
ret = memcmp(hdr->md5_digest, md5_ctx.hash, sizeof(md5_ctx.hash));
if (ret) {
+ fprintf(stderr, "md5: verify failed at %llu/%u\n", io_u->offset, io_u->buflen);
hexdump(hdr->md5_digest, sizeof(hdr->md5_digest));
hexdump(md5_ctx.hash, sizeof(md5_ctx.hash));
}
gettimeofday(&io_u->issue_time, NULL);
add_slat_sample(td, mtime_since(&io_u->start_time, &io_u->issue_time));
- if (td->cur_depth < td->aio_depth) {
+ if (td->cur_depth < td->iodepth) {
timeout = &ts;
min_evts = 0;
} else {
if (td->io_engine & FIO_SYNCIO)
max_units = 1;
else
- max_units = td->aio_depth;
+ max_units = td->iodepth;
td->orig_buffer_size = td->max_bs * max_units + MASK;
unsigned int stonewall;
unsigned int numjobs;
unsigned int use_thread;
+ unsigned int iodepth;
os_cpu_mask_t cpumask;
struct drand48_data bsrange_state;
unsigned long long cur_off;
- void *aio_data;
+ void *io_data;
+ char io_engine_name[16];
int (*io_prep)(struct thread_data *, struct io_u *, int);
int (*io_queue)(struct thread_data *, struct io_u *);
int (*io_getevents)(struct thread_data *, int, int, struct timespec *);
int (*io_cancel)(struct thread_data *, struct io_u *);
void (*io_cleanup)(struct thread_data *);
int (*io_sync)(struct thread_data *);
- unsigned int aio_depth;
unsigned int cur_depth;
struct list_head io_u_freelist;