Skip to content

Commit

Permalink
scripts: Improve I/O, Scheduler and Network tweak
Browse files Browse the repository at this point in the history
Signed-off-by: Rem01Gaming <[email protected]>
  • Loading branch information
Rem01Gaming committed Nov 21, 2024
1 parent 122a1df commit 190da99
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/scripts/encore-normal
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ change_permission 644 /sys/devices/virtual/thermal/thermal_message/cpu_limits

# I/O Tweaks
for queue in /sys/block/mmcblk0/queue /sys/block/mmcblk1/queue /sys/block/sd*/queue; do
# Fallback to latency friendly
# Reduce heuristic read-ahead in exchange for I/O latency
apply 128 "$queue/read_ahead_kb"

# Reduce the maximum number of I/O requests in exchange for latency
apply 64 "$queue/nr_requests"
done &

mediatek_tweak() {
Expand Down
9 changes: 5 additions & 4 deletions src/scripts/encore-perfcommon
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ for queue in /sys/block/mmcblk0/queue /sys/block/mmcblk1/queue /sys/block/sd*/qu
# Disable I/O statistics accounting
apply 0 "$queue/iostats"

# Reduce the maximum number of I/O requests in exchange for latency
apply 64 "$queue/nr_requests"

# Don't use I/O as random spice
# Don't use I/O as source of randomness
apply 0 "$queue/add_random"
done &

Expand All @@ -38,6 +35,7 @@ apply "1" /proc/sys/net/ipv4/tcp_ecn
apply "3" /proc/sys/net/ipv4/tcp_fastopen
apply "1" /proc/sys/net/ipv4/tcp_sack
apply "0" /proc/sys/net/ipv4/tcp_timestamps
apply "0" /proc/sys/net/ipv4/tcp_syncookies

# Disable ccci debugging
apply 0 /sys/kernel/ccci/debug
Expand All @@ -64,6 +62,9 @@ apply 1 /proc/sys/kernel/sched_child_runs_first
# Improve real time latencies by reducing the scheduler migration time
apply 32 /proc/sys/kernel/sched_nr_migrate

# Preliminary requirement for the following values
apply 0 /proc/sys/kernel/sched_tunable_scaling

# Tweaking scheduler to reduce latency
apply 50000 /proc/sys/kernel/sched_migration_cost_ns
apply 1000000 /proc/sys/kernel/sched_min_granularity_ns
Expand Down
7 changes: 5 additions & 2 deletions src/scripts/encore-performance
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,11 @@ change_permission 000 /sys/devices/virtual/thermal/thermal_message/cpu_limits

# I/O Tweaks
for queue in /sys/block/mmcblk0/queue /sys/block/mmcblk1/queue /sys/block/sd*/queue; do
# Most games nowadays have big assets that requires more throughput
apply 312 "$queue/read_ahead_kb"
# Reduce heuristic read-ahead in exchange for I/O latency
apply 32 "$queue/read_ahead_kb"

# Reduce the maximum number of I/O requests in exchange for latency
apply 32 "$queue/nr_requests"
done &

mediatek_tweak() {
Expand Down

0 comments on commit 190da99

Please sign in to comment.