Use cleaner path syntaxing

Signed-off-by: tytydraco <tylernij@gmail.com>
latency
tytydraco 4 years ago
parent 727ea6f563
commit b3a42f955b

@ -129,10 +129,10 @@ then
fi fi
# Loop over each CPU in the system # Loop over each CPU in the system
for cpu in /sys/devices/system/cpu/cpu*/cpufreq/ for cpu in /sys/devices/system/cpu/cpu*/cpufreq
do do
# Fetch the available governors from the CPU # Fetch the available governors from the CPU
avail_govs="$(cat "${cpu}scaling_available_governors")" avail_govs="$(cat "$cpu/scaling_available_governors")"
# Attempt to set the governor in this order # Attempt to set the governor in this order
for governor in schedutil interactive for governor in schedutil interactive
@ -140,7 +140,7 @@ do
# Once a matching governor is found, set it and break for this CPU # Once a matching governor is found, set it and break for this CPU
if [[ "$avail_govs" == *"$governor"* ]] if [[ "$avail_govs" == *"$governor"* ]]
then then
write "${cpu}scaling_governor" "$governor" write "$cpu/scaling_governor" "$governor"
break break
fi fi
done done
@ -171,33 +171,33 @@ do
write "$governor/hispeed_freq" "$UINT_MAX" write "$governor/hispeed_freq" "$UINT_MAX"
done done
for queue in /sys/block/*/queue/ for queue in /sys/block/*/queue
do do
# Choose the first governor available # Choose the first governor available
avail_scheds="$(cat "${queue}scheduler")" avail_scheds="$(cat "$queue/scheduler")"
for sched in cfq noop kyber bfq mq-deadline none for sched in cfq noop kyber bfq mq-deadline none
do do
if [[ "$avail_scheds" == *"$sched"* ]] if [[ "$avail_scheds" == *"$sched"* ]]
then then
write "${queue}scheduler" "$sched" write "$queue/scheduler" "$sched"
break break
fi fi
done done
# Do not use I/O as a source of randomness # Do not use I/O as a source of randomness
write "${queue}add_random" 0 write "$queue/add_random" 0
# Disable I/O statistics accounting # Disable I/O statistics accounting
write "${queue}iostats" 0 write "$queue/iostats" 0
# Only attempt simple merges # Only attempt simple merges
write "${queue}nomerges" 1 write "$queue/nomerges" 1
# Reduce heuristic read-ahead in exchange for I/O latency # Reduce heuristic read-ahead in exchange for I/O latency
write "${queue}read_ahead_kb" 16 write "$queue/read_ahead_kb" 16
# Reduce the maximum number of I/O requests in exchange for latency # Reduce the maximum number of I/O requests in exchange for latency
write "${queue}nr_requests" 64 write "$queue/nr_requests" 64
done done
# Always return success, even if the last write fails # Always return success, even if the last write fails

Loading…
Cancel
Save