-
Notifications
You must be signed in to change notification settings - Fork 76
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
Add support to parse multiple cores for setting CPU affinity #208
Add support to parse multiple cores for setting CPU affinity #208
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #208 +/- ##
==========================================
+ Coverage 72.55% 72.72% +0.17%
==========================================
Files 7 7
Lines 419 429 +10
Branches 68 71 +3
==========================================
+ Hits 304 312 +8
Misses 73 73
- Partials 42 44 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
I just saw the PR by chance and was interested as I authored the original one. I am wondering in which (realtime) scenario would you like to prefer a set of cores? From my understanding every time a thread is executed on the different core we suffer from a) Context switch overhead Both brings in an uncertainty which we do not want in RT scenarios. The only case I can imagine this could help is modern CPUs with multiple dies inside (e.g. most Ryzen processors). But the OS scheduler will already take care of trying not to move threads between cores on different dies per default. |
@firesurfer You can set it at the startup as we do in the ros2_control_node or in the configure of controllers and hardware components |
I am aware of that. But I just wanted to understand why it is an advantage in a RT scenario to use the group of cores instead of tying the thread to a single core. |
By default, it uses mostly Core 0 as other. If you can use a set of performance cores, it would be better for the RT application, if your application needs more computational power than one core, then this definitely helps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@Mergifyio backport humble |
✅ Backports have been created
|
(cherry picked from commit efcb786)
This PR adds a new method that helps to set multiple CPUs for affinity instead of only one and this will help in choosing couple of CPUs to run the controller_manager etc