-
Notifications
You must be signed in to change notification settings - Fork 77
Description
Describe the bug
At some point, an example was included to pin CFE core apps to core 0.
Problem is - no affinity is set (at all) for other apps, and so these will inherit the affinity of the parent. Because apps are started from ES, which was pinned to 0, this means all apps end up getting pinned to 0.
To Reproduce
Run multiple threads on a multi-core machine. It becomes evident that only one thread is running at a time.
Expected behavior
If multiple threads are running and multiple cores are available, OS should (by default) float threads between cores.
Code snips
PSP/fsw/pc-linux/src/cfe_psp_start.c
Lines 182 to 187 in eaf80b1
| if (strncmp(taskname, "CFE_", 4) == 0) | |
| { | |
| CPU_ZERO(&cpuset); | |
| CPU_SET(0, &cpuset); | |
| pthread_setaffinity_np(pthread_self(), sizeof(cpuset), &cpuset); | |
| } |
System observed on:
Debian
Additional context
To work as the comment suggests, this needs to have an "else" statement that sets the affinity to all cores, or else everything will end up inheriting the assignment of CFE_ES.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.