Last active
November 15, 2019 15:00
-
-
Save foundObjects/76d72917f348b04b3a75c781e80f1eb8 to your computer and use it in GitHub Desktop.
Pinebook Pro Ubuntu/Debian interrupt tuning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/systemd/system/boot-performance-tuning.service | |
# run 'systemctl daemon-reload' after installing, then 'systemctl enable boot-performance-tuning' | |
[Unit] | |
Description=PBP Performance Tuning | |
After=basic.target | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/local/sbin/performance-tuning.sh | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# /usr/local/sbin/performance-tuning.sh | |
# zfs-initramfs defaults to mounting the rootfs "relatime" regardless of dataset properties | |
mount -o remount,noatime / | |
echo 1 > /sys/devices/system/cpu/cpufreq/policy0/interactive/io_is_busy | |
echo 1 > /sys/devices/system/cpu/cpufreq/policy4/interactive/io_is_busy | |
# gpu & vop on cpu5 (big) | |
for i in $(awk -F':' '/gpu/{print $1}' </proc/interrupts | sed 's/\ //g'); do | |
echo 5 >/proc/irq/$i/smp_affinity_list | |
done | |
for i in $(awk -F':' '/vop/{print $1}' </proc/interrupts | sed 's/\ //g'); do | |
echo 5 >/proc/irq/$i/smp_affinity_list | |
done | |
# pcie on cpu4 (big) | |
for i in $(awk -F':' 'tolower($0) ~ /pcie/{print $1}' </proc/interrupts | sed 's/\ //g'); do | |
echo 4 >/proc/irq/$i/smp_affinity_list | |
done | |
# mmc on cpu3 | |
for i in $(awk -F':' '/mmc1/{print $1}' </proc/interrupts | sed 's/\ //g'); do | |
echo 3 >/proc/irq/$i/smp_affinity_list | |
done | |
# usb3 on cpu3 | |
for i in $(awk -F':' '/xhci/{print $1}' </proc/interrupts | sed 's/\ //g'); do | |
echo 3 >/proc/irq/$i/smp_affinity_list | |
done | |
# dw-mci on cpu2 | |
for i in $(awk -F':' '/dw-mci/{print $1}' </proc/interrupts | sed 's/\ //g'); do | |
echo 2 >/proc/irq/$i/smp_affinity_list | |
done | |
# usb on cpu1 | |
for i in $(awk -F':' '/ehci/{print $1}' </proc/interrupts | sed 's/\ //g'); do | |
echo 1 >/proc/irq/$i/smp_affinity_list | |
done | |
for i in $(awk -F':' '/ohci/{print $1}' </proc/interrupts | sed 's/\ //g'); do | |
echo 1 >/proc/irq/$i/smp_affinity_list | |
done | |
# everything else defaults to cpu0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment