12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #!/bin/bash
- IF=enp0s8
- CPU_NR=3
- PRIO=90
- OLDDIR=$(pwd)
- reset() {
-
- echo ondemand >/sys/devices/system/cpu/cpu$CPU_NR/cpufreq/scaling_governor
- cd /sys/devices/system/cpu/cpu$CPU_NR/cpuidle
- for i in *
- do
-
- echo 0 >$i/disable
- done
- phy=$IF
-
- for i in `ps ax | grep -v grep | grep $phy | sed "s/^ //" | cut -d" " -f1`
- do
-
- taskset -pc 0-$CPU_NR $i >/dev/null
-
- chrt -pf 50 $i
- done
-
- systemctl start irqbalance
- }
- trap reset ERR
- systemctl stop irqbalance
- phy=$IF
- for i in `ps ax | grep -v grep | grep $phy | sed "s/^ //" | cut -d" " -f1`
- do
- taskset -pc $CPU_NR $i >/dev/null
- chrt -pf $PRIO $i
- done
- cd /sys/devices/system/cpu/cpu$CPU_NR/cpuidle
- for i in `ls -1r`
- do
- echo 1 >$i/disable
- done
- echo performance >/sys/devices/system/cpu/cpu$CPU_NR/cpufreq/scaling_governor
- cd $OLDDIR
- taskset -c $CPU_NR chrt -f $PRIO $1
|