From f43516b0ba9864d9f62c56d431dac1f8c8461b0e Mon Sep 17 00:00:00 2001 From: ThomasKaiser Date: Fri, 7 Jul 2017 04:22:52 -0700 Subject: [PATCH] Move ondemand tweaks to armhwinfo --- scripts/armhwinfo | 24 ++++++++++++++++++++++++ scripts/customize-image.sh.template | 13 +------------ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/scripts/armhwinfo b/scripts/armhwinfo index 9e6fe30432..da5f224d83 100644 --- a/scripts/armhwinfo +++ b/scripts/armhwinfo @@ -87,6 +87,20 @@ prepare_board() { -e "s/^\s\+delaycompress/\t# delaycompress/" "${ConfigFile}" done + # tweak ondemand cpufreq governor settings to increase cpufreq with IO load + grep -q ondemand /etc/default/cpufrequtils + if [ $? -eq 0 ]; then + echo ondemand >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + cd /sys/devices/system/cpu + for i in cpufreq/ondemand cpu0/cpufreq/ondemand cpu4/cpufreq/ondemand ; do + if [ -d $i ]; then + echo 1 >${i}/io_is_busy + echo 25 >${i}/up_threshold + echo 10 >${i}/sampling_down_factor + fi + done + fi + # IRQ distribution based on $HARDWARE and/or $BOARD, probably some sort of user feedback (leds) case ${HARDWARE} in Freescale) # i.MX6 boards, send Ethernet to cpu3, MMC to cpu1/cpu2 (when available) @@ -228,6 +242,16 @@ prepare_board() { echo 8 >/proc/irq/$i/smp_affinity done ;; + rock64) # GPU on cpu1, USB3 on cpu2, Ethernet on cpu3 + for i in $(awk -F':' '/Mali/{print $1}' /proc/irq/$i/smp_affinity + done + echo 4 >/proc/irq/$(awk -F":" "/xhci/ {print \$1}" /proc/irq/$(awk -F":" "/eth0/ {print \$1}" /sys/class/net/eth0/queues/rx-0/rps_cpus + echo 32768 >/proc/sys/net/core/rps_sock_flow_entries + echo 32768 >/sys/class/net/eth0/queues/rx-0/rps_flow_cnt + ;; esac ;; esac diff --git a/scripts/customize-image.sh.template b/scripts/customize-image.sh.template index 1bbcad1503..482932c161 100644 --- a/scripts/customize-image.sh.template +++ b/scripts/customize-image.sh.template @@ -134,18 +134,7 @@ InstallOpenMediaVault() { . /usr/share/openmediavault/scripts/helper-functions SMB_Options="min receivefile size = 16384\nwrite cache size = 524288\ngetwd cache = yes\nsocket options = TCP_NODELAY IPTOS_LOWDELAY" xmlstarlet ed -L -u "/config/services/smb/extraoptions" -v "$(echo -e "${SMB_Options}")" ${OMV_CONFIG_FILE} - grep -q ondemand /etc/default/cpufrequtils && sed -i '/^exit\ 0/i \ - echo ondemand >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor \ - sleep 0.1 \ - cd /sys/devices/system/cpu \ - for i in cpufreq/ondemand cpu0/cpufreq/ondemand cpu4/cpufreq/ondemand ; do \ - if [ -d $i ]; then \ - echo 1 >${i}/io_is_busy \ - echo 25 >${i}/up_threshold \ - echo 10 >${i}/sampling_down_factor \ - fi \ - done \ - ' /etc/rc.local + # Special treatment for ODROID-XU4 (and later Amlogic S912, RK3399 and other big.LITTLE # based devices). Move all NAS daemons to the big cores if [ "${BOARD}" = "odroidxu4" ]; then