X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=t%2Fio_uring.c;h=62dee8058a5922b673a4e5c92c65add6735f4574;hb=576d4cf9b040e49ca467cd94db0567d392510e9d;hp=36aede9ba266b949d662034c97b16e5b2d483787;hpb=e39863e3cb61bb750f5e7d87fcf11c2bf4651996;p=fio.git diff --git a/t/io_uring.c b/t/io_uring.c index 36aede9b..62dee805 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -71,7 +71,6 @@ struct submitter { unsigned long reaps; unsigned long done; unsigned long calls; - unsigned long cachehit, cachemiss; volatile int finish; __s32 *fds; @@ -265,14 +264,10 @@ static int reap_events(struct submitter *s) if (cqe->res != BS) { printf("io: unexpected ret=%d\n", cqe->res); if (polled && cqe->res == -EOPNOTSUPP) - printf("Your filesystem doesn't support poll\n"); + printf("Your filesystem/driver/kernel doesn't support polled IO\n"); return -1; } } - if (cqe->flags & IOCQE_FLAG_CACHEHIT) - s->cachehit++; - else - s->cachemiss++; reaped++; head++; } while (1); @@ -497,7 +492,7 @@ static void usage(char *argv) int main(int argc, char *argv[]) { struct submitter *s; - unsigned long done, calls, reap, cache_hit, cache_miss; + unsigned long done, calls, reap; int err, i, flags, fd, opt; char *fdepths; void *ret; @@ -526,7 +521,8 @@ int main(int argc, char *argv[]) } } - submitter = malloc(sizeof(*submitter) * depth * sizeof(struct iovec)); + submitter = malloc(sizeof(*submitter) + depth * sizeof(struct iovec)); + memset(submitter, 0, sizeof(*submitter) + depth * sizeof(struct iovec)); s = submitter; flags = O_RDONLY | O_NOATIME; @@ -599,44 +595,29 @@ int main(int argc, char *argv[]) pthread_create(&s->thread, NULL, submitter_fn, s); fdepths = malloc(8 * s->nr_files); - cache_hit = cache_miss = reap = calls = done = 0; + reap = calls = done = 0; do { unsigned long this_done = 0; unsigned long this_reap = 0; unsigned long this_call = 0; - unsigned long this_cache_hit = 0; - unsigned long this_cache_miss = 0; unsigned long rpc = 0, ipc = 0; - double hit = 0.0; sleep(1); this_done += s->done; this_call += s->calls; this_reap += s->reaps; - this_cache_hit += s->cachehit; - this_cache_miss += s->cachemiss; - if (this_cache_hit && this_cache_miss) { - unsigned long hits, total; - - hits = this_cache_hit - cache_hit; - total = hits + this_cache_miss - cache_miss; - hit = (double) hits / (double) total; - hit *= 100.0; - } if (this_call - calls) { rpc = (this_done - done) / (this_call - calls); ipc = (this_reap - reap) / (this_call - calls); } else rpc = ipc = -1; file_depths(fdepths); - printf("IOPS=%lu, IOS/call=%ld/%ld, inflight=%u (%s), Cachehit=%0.2f%%\n", + printf("IOPS=%lu, IOS/call=%ld/%ld, inflight=%u (%s)\n", this_done - done, rpc, ipc, s->inflight, - fdepths, hit); + fdepths); done = this_done; calls = this_call; reap = this_reap; - cache_hit = s->cachehit; - cache_miss = s->cachemiss; } while (!finish); pthread_join(s->thread, &ret);