Skip to content

Commit

Permalink
Merge pull request #366 from rubytest03/support_more_fio_parametric
Browse files Browse the repository at this point in the history
Support more fio parameters
  • Loading branch information
rli9 authored Apr 16, 2024
2 parents d075562 + eeda272 commit 9e54ebe
Showing 1 changed file with 54 additions and 5 deletions.
59 changes: 54 additions & 5 deletions setup/fio-setup-basic
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# - ioengine
# - iodepth
# - direct
# - offset_increment
# - test_size
# - nr_task
# - fallocate
Expand All @@ -20,7 +21,10 @@
# - numa_cpu_nodes
# - pre_read
# - rwmixread
# - refill_buffers
# - cpuload
# - cpus_allowed_policy
# - cpus_allowed
# - donorname
# - testfile

Expand Down Expand Up @@ -54,6 +58,7 @@ size=$((test_size / nr_task))
direct=$(parse_bool $direct)
raw_disk=$(parse_bool $raw_disk)
pre_read=$(parse_bool $pre_read)
refill_buffers=$(parse_bool $refill_buffers)

if [ "$raw_disk" = 1 ]; then
storages=$partitions
Expand Down Expand Up @@ -85,20 +90,31 @@ bs=$bs
ioengine=$ioengine
iodepth=$iodepth
size=$size
nr_files=$nr_files
filesize=$filesize
direct=$direct
runtime=$runtime
invalidate=$invalidate
fallocate=$fallocate
io_size=$io_size
file_service_type=$file_service_type
random_distribution=$random_distribution
group_reporting
create_only=1
pre_read=$pre_read
"

if [ -z "$offset_increment" ]; then
create_task="
$create_task
nr_files=$nr_files
filesize=$filesize
invalidate=$invalidate
fallocate=$fallocate
io_size=$io_size
"
else
create_task="
$create_task
offset_increment=$offset_increment
"
fi

if parse_bool -q "$time_based"; then
create_task="
$create_task
Expand All @@ -113,6 +129,13 @@ cpuload=$cpuload
"
fi

if parse_bool -q "$refill_buffers"; then
create_task="
$create_task
refill_buffers
"
fi

if parse_bool -q "$donorname"; then
create_task="
$create_task
Expand Down Expand Up @@ -180,6 +203,30 @@ __numa_cpu_nodes()
parse_numa_mem_policy
parse_numa_cpu_nodes

parse_cpus_allowed_policy()
{
if [ "$cpus_allowed_policy" = "split" ]; then
echo "cpus_allowed_policy=${cpus_allowed_policy}"
elif [ "$cpus_allowed_policy" = "shared" ]; then
echo "cpus_allowed_policy=${cpus_allowed_policy}"
fi

}

parse_cpus_allowed()
{
if [ "$cpus_allowed_policy" = "split" ]; then
[ -n "$cpus_allowed" ] || die "cpus_allowed must be specified for fio"

echo "cpus_allowed=${cpus_allowed}"
else
[ -z "$cpus_allowed" ] || die "cpus_allowed_policy is not split, cpus_allowed shouldn't be specified for fio"
fi
}

parse_cpus_allowed_policy
parse_cpus_allowed

no=0

for storage in $storages; do
Expand Down Expand Up @@ -218,6 +265,8 @@ numjobs=$jobs_per_storage
$rwmixread_setup
$(__numa_mem_policy $no)
$(__numa_cpu_nodes $no)
$(parse_cpus_allowed_policy)
$(parse_cpus_allowed)
"
no=$((no+1))
done
Expand Down

0 comments on commit 9e54ebe

Please sign in to comment.