Tune IRQs on the new roboRIO for lower latency
This pulls peak wakeup latency down from 800 uS or more to 150 uS. Most
of this is changing ktimersoftd/* to be high priority.
While we are here, most of the IRQs, including MMC are running at RT
priority 15. Anything we want to run needs to be higher than 15. Move
the networking stack and message_bridge up above that so we get low
latency communications.
Change-Id: I14ede0fdeb2a008f482feae75fa04cabc3f5abeb
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/frc971/wpilib/wpilib_robot_base.h b/frc971/wpilib/wpilib_robot_base.h
index 33a17bc..bcde100 100644
--- a/frc971/wpilib/wpilib_robot_base.h
+++ b/frc971/wpilib/wpilib_robot_base.h
@@ -54,6 +54,12 @@
// it. This is in here instead of starter.sh because starter.sh doesn't run
// with permissions on a roboRIO.
PCHECK(system("echo 0 > /proc/sys/vm/overcommit_memory") == 0);
+ PCHECK(system("busybox ps -ef | grep '\\[ktimersoftd/0\\]' | awk '{print "
+ "$1}' | xargs chrt -f -p 70") == 0);
+ PCHECK(system("busybox ps -ef | grep '\\[ktimersoftd/1\\]' | awk '{print "
+ "$1}' | xargs chrt -f -p 70") == 0);
+ PCHECK(system("busybox ps -ef | grep '\\[irq/54-eth0\\]' | awk '{print "
+ "$1}' | xargs chrt -f -p 17") == 0);
// Configure throttling so we reserve 5% of the CPU for non-rt work.
// This makes things significantly more stable when work explodes.