aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-04-08 12:48:50 -0400
committerJens Axboe <axboe@kernel.dk>2019-04-08 12:48:50 -0400
commit704236672edacf353c362bab70c3d3eda7bb4a51 (patch)
tree692cf88479fd2df2bd28c96ec9e5fffccd017cb5
parent1200e07f3ad4b9d976cf2fff3a0c3d9a1faecb3e (diff)
tools/io_uring: remove IOCQE_FLAG_CACHEHIT
This ended up not being included in the mainline version of io_uring, so drop it from the test app as well. Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--tools/io_uring/io_uring-bench.c32
1 files changed, 4 insertions, 28 deletions
diff --git a/tools/io_uring/io_uring-bench.c b/tools/io_uring/io_uring-bench.c
index 512306a37531..0f257139b003 100644
--- a/tools/io_uring/io_uring-bench.c
+++ b/tools/io_uring/io_uring-bench.c
@@ -32,10 +32,6 @@
32#include "liburing.h" 32#include "liburing.h"
33#include "barrier.h" 33#include "barrier.h"
34 34
35#ifndef IOCQE_FLAG_CACHEHIT
36#define IOCQE_FLAG_CACHEHIT (1U << 0)
37#endif
38
39#define min(a, b) ((a < b) ? (a) : (b)) 35#define min(a, b) ((a < b) ? (a) : (b))
40 36
41struct io_sq_ring { 37struct io_sq_ring {
@@ -85,7 +81,6 @@ struct submitter {
85 unsigned long reaps; 81 unsigned long reaps;
86 unsigned long done; 82 unsigned long done;
87 unsigned long calls; 83 unsigned long calls;
88 unsigned long cachehit, cachemiss;
89 volatile int finish; 84 volatile int finish;
90 85
91 __s32 *fds; 86 __s32 *fds;
@@ -270,10 +265,6 @@ static int reap_events(struct submitter *s)
270 return -1; 265 return -1;
271 } 266 }
272 } 267 }
273 if (cqe->flags & IOCQE_FLAG_CACHEHIT)
274 s->cachehit++;
275 else
276 s->cachemiss++;
277 reaped++; 268 reaped++;
278 head++; 269 head++;
279 } while (1); 270 } while (1);
@@ -489,7 +480,7 @@ static void file_depths(char *buf)
489int main(int argc, char *argv[]) 480int main(int argc, char *argv[])
490{ 481{
491 struct submitter *s = &submitters[0]; 482 struct submitter *s = &submitters[0];
492 unsigned long done, calls, reap, cache_hit, cache_miss; 483 unsigned long done, calls, reap;
493 int err, i, flags, fd; 484 int err, i, flags, fd;
494 char *fdepths; 485 char *fdepths;
495 void *ret; 486 void *ret;
@@ -569,44 +560,29 @@ int main(int argc, char *argv[])
569 pthread_create(&s->thread, NULL, submitter_fn, s); 560 pthread_create(&s->thread, NULL, submitter_fn, s);
570 561
571 fdepths = malloc(8 * s->nr_files); 562 fdepths = malloc(8 * s->nr_files);
572 cache_hit = cache_miss = reap = calls = done = 0; 563 reap = calls = done = 0;
573 do { 564 do {
574 unsigned long this_done = 0; 565 unsigned long this_done = 0;
575 unsigned long this_reap = 0; 566 unsigned long this_reap = 0;
576 unsigned long this_call = 0; 567 unsigned long this_call = 0;
577 unsigned long this_cache_hit = 0;
578 unsigned long this_cache_miss = 0;
579 unsigned long rpc = 0, ipc = 0; 568 unsigned long rpc = 0, ipc = 0;
580 double hit = 0.0;
581 569
582 sleep(1); 570 sleep(1);
583 this_done += s->done; 571 this_done += s->done;
584 this_call += s->calls; 572 this_call += s->calls;
585 this_reap += s->reaps; 573 this_reap += s->reaps;
586 this_cache_hit += s->cachehit;
587 this_cache_miss += s->cachemiss;
588 if (this_cache_hit && this_cache_miss) {
589 unsigned long hits, total;
590
591 hits = this_cache_hit - cache_hit;
592 total = hits + this_cache_miss - cache_miss;
593 hit = (double) hits / (double) total;
594 hit *= 100.0;
595 }
596 if (this_call - calls) { 574 if (this_call - calls) {
597 rpc = (this_done - done) / (this_call - calls); 575 rpc = (this_done - done) / (this_call - calls);
598 ipc = (this_reap - reap) / (this_call - calls); 576 ipc = (this_reap - reap) / (this_call - calls);
599 } else 577 } else
600 rpc = ipc = -1; 578 rpc = ipc = -1;
601 file_depths(fdepths); 579 file_depths(fdepths);
602 printf("IOPS=%lu, IOS/call=%ld/%ld, inflight=%u (%s), Cachehit=%0.2f%%\n", 580 printf("IOPS=%lu, IOS/call=%ld/%ld, inflight=%u (%s)\n",
603 this_done - done, rpc, ipc, s->inflight, 581 this_done - done, rpc, ipc, s->inflight,
604 fdepths, hit); 582 fdepths);
605 done = this_done; 583 done = this_done;
606 calls = this_call; 584 calls = this_call;
607 reap = this_reap; 585 reap = this_reap;
608 cache_hit = s->cachehit;
609 cache_miss = s->cachemiss;
610 } while (!finish); 586 } while (!finish);
611 587
612 pthread_join(s->thread, &ret); 588 pthread_join(s->thread, &ret);