Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support more fio parameters #366

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading