Advertisement
Guest User

Untitled

a guest
Aug 6th, 2019
849
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Enable performance govenor and move threads to un-used CPUs
  4. #export DISPLAY=:0.0
  5. case $@ in
  6. -1) echo "Performance Enabled"
  7. #set reserved cores
  8. /bin/cset set system -c 0,1,8,9
  9. /bin/cset proc --move --fromset=root --toset=system --threads --kthread --force
  10. #set the governor
  11. /bin/cpupower frequency-set -g performance
  12. #set the irq mask for passed devices
  13. grep vfio /proc/interrupts | cut -b 3-4 | while read -r i ; do
  14. echo "set mask fcfc to irq $i"
  15. echo fcfc >/proc/irq/$i/smp_affinity
  16. done
  17.  
  18. ;;
  19.  
  20. -2) echo "Perfomance Disabled"
  21. /bin/cset proc --move --fromset=system --toset=root --threads --kthread --force
  22. /bin/cpupower frequency-set -g schedutil
  23. ;;
  24.  
  25. -3) echo "Performance Enabled"
  26. #set reserved cores
  27. /bin/cset set system -c 0-7
  28. /bin/cset proc --move --fromset=root --toset=system --threads --kthread --force
  29. #set the governor
  30. /bin/cpupower frequency-set -g performance
  31. #set the irq mask for passed devices
  32. grep vfio /proc/interrupts | cut -b 3-4 | while read -r i ; do
  33. echo "set mask ff00 to irq $i"
  34. echo ff00 >/proc/irq/$i/smp_affinity
  35. done
  36.  
  37. ;;
  38.  
  39. *) echo "Nothing Selected"
  40. ;;
  41. esac
  42. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement