From eaca9b10b7a6d9bb2d8e2eea844ac4f94bd473c5 Mon Sep 17 00:00:00 2001 From: Kurt Nistelberger Date: Fri, 23 Sep 2022 18:51:07 -0700 Subject: [PATCH] pin sensord and lsm interrupt to core 1, for better timing (#25867) Co-authored-by: Kurt Nistelberger old-commit-hash: 755f24885aa3e89933cc8ad9784cdaf480156239 --- selfdrive/sensord/sensors_qcom2.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/selfdrive/sensord/sensors_qcom2.cc b/selfdrive/sensord/sensors_qcom2.cc index ded4b5c0b1..5e741a89a5 100644 --- a/selfdrive/sensord/sensors_qcom2.cc +++ b/selfdrive/sensord/sensors_qcom2.cc @@ -174,6 +174,11 @@ int sensor_loop() { return -1; } + // increase interrupt quality by pinning interrupt and process to core 1 + setpriority(PRIO_PROCESS, 0, -18); + util::set_core_affinity({1}); + std::system("sudo su -c 'echo 1 > /proc/irq/336/smp_affinity_list'"); + PubMaster pm({"sensorEvents"}); init_ts = nanos_since_boot(); @@ -207,7 +212,7 @@ int sensor_loop() { std::this_thread::sleep_for(std::chrono::milliseconds(10) - (end - begin)); } - for (Sensor *sensor : sensors) { + for (Sensor *sensor : sensors) { sensor->shutdown(); } @@ -217,6 +222,5 @@ int sensor_loop() { } int main(int argc, char *argv[]) { - setpriority(PRIO_PROCESS, 0, -18); return sensor_loop(); }