From 05fe01e30be1c6ceaac4e0ad7b07c3d6e6b8c3d7 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 2 Dec 2020 20:44:14 -0800 Subject: [PATCH] set camera and gpu irq affinities (#2678) * pin camera and gpu to core 2 * can't forget about 177 --- launch_chffrplus.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh index 076697c885..a7a3ada05b 100755 --- a/launch_chffrplus.sh +++ b/launch_chffrplus.sh @@ -17,7 +17,9 @@ function two_init { # Wifi scan wpa_cli IFNAME=wlan0 SCAN - # Restrict Android and other system processes to the first two cores + # *** shield cores 2-3 *** + + # android gets two cores echo 0-1 > /dev/cpuset/background/cpus echo 0-1 > /dev/cpuset/system-background/cpus echo 0-1 > /dev/cpuset/foreground/cpus @@ -27,7 +29,8 @@ function two_init { # openpilot gets all the cores echo 0-3 > /dev/cpuset/app/cpus - # set up governors + # *** set up governors *** + # +50mW offroad, +500mW onroad for 30% more RAM bandwidth echo "performance" > /sys/class/devfreq/soc:qcom,cpubw/governor echo 1056000 > /sys/class/devfreq/soc:qcom,m4m/max_freq @@ -43,6 +46,8 @@ function two_init { # /sys/class/devfreq/soc:qcom,mincpubw is the only one left at "powersave" # it seems to gain nothing but a wasted 500mW + # *** set up IRQ affinities *** + # Collect RIL and other possibly long-running I/O interrupts onto CPU 1 echo 1 > /proc/irq/78/smp_affinity_list # qcom,smd-modem (LTE radio) echo 1 > /proc/irq/33/smp_affinity_list # ufshcd (flash storage) @@ -53,6 +58,13 @@ function two_init { [ -d "/proc/irq/733" ] && echo 3 > /proc/irq/733/smp_affinity_list # USB for LeEco [ -d "/proc/irq/736" ] && echo 3 > /proc/irq/736/smp_affinity_list # USB for OP3T + # GPU and camera get cpu 2 + CAM_IRQS="177 178 179 180 181 182 183 184 185 186 192" + for irq in $CAM_IRQS; do + echo 2 > /proc/irq/$irq/smp_affinity_list + done + echo 2 > /proc/irq/193/smp_affinity_list # GPU + # Check for NEOS update if [ $(< /VERSION) != "$REQUIRED_NEOS_VERSION" ]; then if [ -f "$DIR/scripts/continue.sh" ]; then