Skip to content

Commit

Permalink
iotune: ignore shards with id above max_iodepth
Browse files Browse the repository at this point in the history
If max_iodepth is less than smp::count, then the
calculated io_depth_per_shard can be zero for shards
with id that is greater or equal to the max_iodepth.
This causes runtime error during random read and
random write measurements.

Such sitation was encountered when iotune was run on
a machine with 128 CPUs and non-RAID disk that showed
max_iodepth=127.

This change introudces a logic that prints a warning in
such case and skips performing measurements on shards
that would have io_depth_per_shard=0.

Refs: #2169

Signed-off-by: Patryk Wrobel <[email protected]>

Closes #2201
  • Loading branch information
pwrobelse authored and xemul committed Apr 23, 2024
1 parent b5a0307 commit a965080
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions apps/iotune/iotune.cc
Original file line number Diff line number Diff line change
Expand Up @@ -563,13 +563,23 @@ class iotune_multi_shard_context {

future<io_rates> write_random_data(size_t buffer_size, std::chrono::duration<double> duration) {
return _iotune_test_file.map_reduce0([buffer_size, this, duration] (test_file& tf) {
return tf.write_workload(buffer_size, test_file::pattern::random, per_shard_io_depth(), duration, sharded_rates.local());
const auto shard_io_depth = per_shard_io_depth();
if (shard_io_depth == 0) {
return make_ready_future<io_rates>();
} else {
return tf.write_workload(buffer_size, test_file::pattern::random, shard_io_depth, duration, sharded_rates.local());
}
}, io_rates(), std::plus<io_rates>());
}

future<io_rates> read_random_data(size_t buffer_size, std::chrono::duration<double> duration) {
return _iotune_test_file.map_reduce0([buffer_size, this, duration] (test_file& tf) {
return tf.read_workload(buffer_size, test_file::pattern::random, per_shard_io_depth(), duration, sharded_rates.local());
const auto shard_io_depth = per_shard_io_depth();
if (shard_io_depth == 0) {
return make_ready_future<io_rates>();
} else {
return tf.read_workload(buffer_size, test_file::pattern::random, shard_io_depth, duration, sharded_rates.local());
}
}, io_rates(), std::plus<io_rates>());
}

Expand Down Expand Up @@ -774,6 +784,12 @@ int main(int ac, char** av) {
iotune_logger.info("Disk parameters: max_iodepth={} disks_per_array={} minimum_io_size={}",
test_directory.max_iodepth(), test_directory.disks_per_array(), test_directory.minimum_io_size());

if (test_directory.max_iodepth() < smp::count) {
iotune_logger.warn("smp::count={} is greater than max_iodepth={} - shards above max_io_depth "
"will be ignored during random read and random write measurements",
smp::count, test_directory.max_iodepth());
}

::iotune_multi_shard_context iotune_tests(test_directory);
iotune_tests.start().get();
auto stop = defer([&iotune_tests] () noexcept {
Expand Down

0 comments on commit a965080

Please sign in to comment.