Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All apps/tasks are pinned to core 0 on pc-linux #420

Open
jphickey opened this issue Nov 28, 2023 · 0 comments
Open

All apps/tasks are pinned to core 0 on pc-linux #420

jphickey opened this issue Nov 28, 2023 · 0 comments

Comments

@jphickey
Copy link
Contributor

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

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.

@jphickey jphickey changed the title All apps/tasks are pinned to core 0 on POSIX All apps/tasks are pinned to core 0 on pc-linux Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant