#!/bin/bash

if [ $(cat /proc/cpuinfo |grep ^Hardware|grep BCM270[89]| wc -l) -eq 0 ] ; then
        exit
fi

echo -n "  $(basename $0) - tunning Raspberry Pi... "

#ifconfig eth0 txqueuelen 10000

#for IRQ in /proc/irq/* ; do echo 01 > $IRQ/smp_affinity ; done
#for PID in $(pgrep ci_hdrc) ; do taskset -p 01 $PID ; done
#taskset -pca 2,3 $(pgrep mpd)

#pgrep cifsd && chrt -f -p 49 $(pgrep cifsd)

if [ -d /sys/devices/system/cpu/cpu0/cpufreq/ ] ; then
        for CPU in /sys/devices/system/cpu/cpu[0-9]/cpufreq/ ; do
                echo performance > $CPU/scaling_governor
        done
fi

echo "Done."

