Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Enable performance govenor and move threads to un-used CPUs
- #export DISPLAY=:0.0
- case $@ in
- -1) echo "Performance Enabled"
- #set reserved cores
- /bin/cset set system -c 0,1,8,9
- /bin/cset proc --move --fromset=root --toset=system --threads --kthread --force
- #set the governor
- /bin/cpupower frequency-set -g performance
- #set the irq mask for passed devices
- grep vfio /proc/interrupts | cut -b 3-4 | while read -r i ; do
- echo "set mask fcfc to irq $i"
- echo fcfc >/proc/irq/$i/smp_affinity
- done
- ;;
- -2) echo "Perfomance Disabled"
- /bin/cset proc --move --fromset=system --toset=root --threads --kthread --force
- /bin/cpupower frequency-set -g schedutil
- ;;
- -3) echo "Performance Enabled"
- #set reserved cores
- /bin/cset set system -c 0-7
- /bin/cset proc --move --fromset=root --toset=system --threads --kthread --force
- #set the governor
- /bin/cpupower frequency-set -g performance
- #set the irq mask for passed devices
- grep vfio /proc/interrupts | cut -b 3-4 | while read -r i ; do
- echo "set mask ff00 to irq $i"
- echo ff00 >/proc/irq/$i/smp_affinity
- done
- ;;
- *) echo "Nothing Selected"
- ;;
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement