mirror of
https://github.com/infiniteCable2/openpilot.git
synced 2026-08-05 08:16:03 +08:00
tici: fix set_realtime_priority (#2124)
* cleanup and pin modeld to core 5 * Unused import old-commit-hash: 5c058140edb5678cfc31e5103e57cdb5d1c11305
This commit is contained in:
@@ -50,7 +50,6 @@ void set_thread_name(const char* name) {
|
||||
|
||||
int set_realtime_priority(int level) {
|
||||
#ifdef __linux__
|
||||
|
||||
long tid = syscall(SYS_gettid);
|
||||
|
||||
// should match python using chrt
|
||||
@@ -64,8 +63,7 @@ int set_realtime_priority(int level) {
|
||||
}
|
||||
|
||||
int set_core_affinity(int core) {
|
||||
#ifdef QCOM
|
||||
|
||||
#ifdef __linux__
|
||||
long tid = syscall(SYS_gettid);
|
||||
cpu_set_t rt_cpu;
|
||||
|
||||
|
||||
@@ -92,6 +92,11 @@ int main(int argc, char **argv) {
|
||||
int err;
|
||||
set_realtime_priority(51);
|
||||
|
||||
#ifdef QCOM2
|
||||
// CPU usage is much lower when pinned to a single big core
|
||||
set_core_affinity(4);
|
||||
#endif
|
||||
|
||||
signal(SIGINT, (sighandler_t)set_do_exit);
|
||||
signal(SIGTERM, (sighandler_t)set_do_exit);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user