summaryrefslogtreecommitdiff
path: root/cconv.c
diff options
context:
space:
mode:
authorRoman Pen <r.peniaev@gmail.com>2015-09-27 21:24:55 +0200
committerJens Axboe <axboe@fb.com>2015-10-01 08:54:04 +0200
commit82407585a3b3b10281428e4ca9c2d3e7dfca7392 (patch)
treeff9f953b9d186f7303e545006db03e085b7897b7 /cconv.c
parente63a0b2f293c6bcf3495c547eba414e1a6cf1840 (diff)
Introduce new option: iodepth_batch_complete_max
By now there is an option which is called 'iodepth_batch_complete'. This option provides a possibility to read exact amount of events of completed IOs, e.g. by default it is set to 1, so only 1 event will be read on each io_getevents system call: 7945 io_getevents(139876985688064, 1, 1, {...}NULL) = 1 This option can be set to any desired amount, say the whole iodepth size can be used, e.g. 128: 7952 io_getevents(140303500259328, 128, 128, {...}NULL) = 128 We will not exit the system call till the whole queue will be completed. Sounds not so efficient. In this patch I add the 'iodepth_batch_complete_max' option and rename 'iodepth_batch_complete' to 'iodepth_batch_complete_min' to have a possibility to specify a range of events which I want to read. (of course because of compatibility's sake 'iodepth_batch_complete_min' is an alias for 'iodepth_batch_complete'). So finally if options are set to: # or iodepth_batch_complete_min=1 iodepth_batch_complete=1 # take the iodepth value iodepth_batch_complete_max=128 The io_getevents call will look like: 7961 io_getevents(140173245206528, 1, 128, {...}NULL) = 73 and we will exit the system call with any amount of completed IOs >= 1. What are the benefits? Fetching events from the queue can be done more efficiently on some testing on specific configurations, e.g. stacked block devices based on null_blk devices, where completion happens immediately and events should be retried from the queue ASAP. Let's take a simple example. BASE CONFIG: [global] fadvise_hint=0 rw=randrw:2 direct=1 size=256M ioengine=libaio iodepth=128 time_based=1 runtime=60 ramp_time=10 [job1] filename=/dev/nullb0 [job2] filename=/dev/nullb1 [job3] filename=/dev/nullb2 [job4] filename=/dev/nullb3 Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'cconv.c')
-rw-r--r--cconv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cconv.c b/cconv.c
index 44f17da..fde8c6d 100644
--- a/cconv.c
+++ b/cconv.c
@@ -83,7 +83,8 @@ void convert_thread_options_to_cpu(struct thread_options *o,
o->iodepth = le32_to_cpu(top->iodepth);
o->iodepth_low = le32_to_cpu(top->iodepth_low);
o->iodepth_batch = le32_to_cpu(top->iodepth_batch);
- o->iodepth_batch_complete = le32_to_cpu(top->iodepth_batch_complete);
+ o->iodepth_batch_complete_min = le32_to_cpu(top->iodepth_batch_complete_min);
+ o->iodepth_batch_complete_max = le32_to_cpu(top->iodepth_batch_complete_max);
o->size = le64_to_cpu(top->size);
o->io_limit = le64_to_cpu(top->io_limit);
o->size_percent = le32_to_cpu(top->size_percent);
@@ -300,7 +301,8 @@ void convert_thread_options_to_net(struct thread_options_pack *top,
top->iodepth = cpu_to_le32(o->iodepth);
top->iodepth_low = cpu_to_le32(o->iodepth_low);
top->iodepth_batch = cpu_to_le32(o->iodepth_batch);
- top->iodepth_batch_complete = cpu_to_le32(o->iodepth_batch_complete);
+ top->iodepth_batch_complete_min = cpu_to_le32(o->iodepth_batch_complete_min);
+ top->iodepth_batch_complete_max = cpu_to_le32(o->iodepth_batch_complete_max);
top->size_percent = cpu_to_le32(o->size_percent);
top->fill_device = cpu_to_le32(o->fill_device);
top->file_append = cpu_to_le32(o->file_append);