Skip to content

Fix the CPU affinity of the ros2_control_node (backport #2509)#2822

Closed
mergify[bot] wants to merge 2 commits into
humblefrom
mergify/bp/humble/pr-2509
Closed

Fix the CPU affinity of the ros2_control_node (backport #2509)#2822
mergify[bot] wants to merge 2 commits into
humblefrom
mergify/bp/humble/pr-2509

Conversation

@mergify

@mergify mergify Bot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

If we set the CPU affinity to the controller_manager, with the current setup the non-RT things also run on the same CPU and time to time the RT node is being blocked for sometimes for some reasons.

Changing it to only RT loop fixes the current issue

Without the fix:

    PID     TID PSR %CPU %MEM CLS RTPRIO PRI
  21006   21006   6  0.0  1.3 TS       -  19
  21006   21019   6  0.0  1.3 TS       -  19
  21006   21020   2  0.0  1.3 TS       -  19
  21006   21021   2  0.0  1.3 TS       -  19
  21006   21022   7  0.0  1.3 TS       -  19
  21006   21023   6  0.0  1.3 TS       -  19
  21006   21024   3  0.0  1.3 TS       -  19
  21006   21025   6  0.0  1.3 TS       -  19
  21006   21026   1  0.0  1.3 TS       -  19
  21006   21027   0  1.4  1.3 TS       -  19
  21006   21028   3  1.5  1.3 TS       -  19
  21006   21029   6 14.7  1.3 FF      50  90
  21006   21030   6  0.0  1.3 TS       -  19
  21006   21031   6  0.0  1.3 TS       -  19
  21006   21032   6  0.0  1.3 TS       -  19
  21006   21033   6  0.0  1.3 TS       -  19
  21006   21034   6  0.0  1.3 TS       -  19
  21006   21035   6  0.0  1.3 TS       -  19
  21006   21036   6  0.0  1.3 TS       -  19
  21006   21037   4 16.4  1.3 FF      70 110
  21006   21042   6  0.7  1.3 FF      50  90
  21006   21048   6  0.0  1.3 TS       -  19
  21006   21052   6  3.2  1.3 TS       -  19
  21006   21053   6  4.2  1.3 TS       -  19
  21006   21054   6  3.2  1.3 TS       -  19
  21006   21055   6  0.0  1.3 TS       -  19
  21006   21056   6  1.2  1.3 TS       -  19
  21006   21057   6  0.2  1.3 TS       -  19
  21006   21058   6  0.2  1.3 TS       -  19
  21006   21059   6  0.2  1.3 TS       -  19
  21006   21060   6  0.2  1.3 TS       -  19
  21006   21061   6  0.2  1.3 TS       -  19
  21006   21062   6  0.2  1.3 TS       -  19
  21006   21063   6  0.2  1.3 TS       -  19
  21006   21064   6  0.2  1.3 TS       -  19
  21006   21688   6  0.1  1.3 TS       -  19
  21006   21689   6  0.9  1.3 TS       -  19
  21006   21697   6  0.0  1.3 TS       -  19
  21006   21717   6  0.0  1.3 TS       -  19
  21006   21726   6  0.0  1.3 TS       -  19
  21006   21734   6  0.0  1.3 TS       -  19
  21006   21735   6  0.8  1.3 TS       -  19
  21006   21744   6  0.0  1.3 TS       -  19
  21006   21779   6  0.0  1.3 TS       -  19

With the current fix: (All threads are running on different cores, except the RT with thread priorities)

    PID     TID PSR %CPU %MEM CLS RTPRIO PRI
  15006   15006   6  0.0  1.3 TS       -  19
  15006   15019   6  0.0  1.3 TS       -  19
  15006   15020   2  0.0  1.3 TS       -  19
  15006   15021   2  0.0  1.3 TS       -  19
  15006   15022   7  0.0  1.3 TS       -  19
  15006   15023   6  0.0  1.3 TS       -  19
  15006   15024   3  0.0  1.3 TS       -  19
  15006   15025   6  0.0  1.3 TS       -  19
  15006   15026   1  0.0  1.3 TS       -  19
  15006   15027   0  1.2  1.3 TS       -  19
  15006   15028   3  1.2  1.3 TS       -  19
  15006   15029   6 14.7  1.3 FF      50  90
  15006   15030   5  0.0  1.3 TS       -  19
  15006   15031   3  0.0  1.3 TS       -  19
  15006   15032   0  0.0  1.3 TS       -  19
  15006   15033   2  0.0  1.3 TS       -  19
  15006   15034   1  0.0  1.3 TS       -  19
  15006   15035   5  0.0  1.3 TS       -  19
  15006   15036   6  0.0  1.3 TS       -  19
  15006   15037   4 16.4  1.3 FF      70 110
  15006   15042   1  0.7  1.3 FF      50  90
  15006   15048   0  0.0  1.3 TS       -  19
  15006   15052   3  3.2  1.3 TS       -  19
  15006   15053   4  4.2  1.3 TS       -  19
  15006   15054   0  3.2  1.3 TS       -  19
  15006   15055   0  0.0  1.3 TS       -  19
  15006   15056   6  1.2  1.3 TS       -  19
  15006   15057   4  0.2  1.3 TS       -  19
  15006   15058   6  0.2  1.3 TS       -  19
  15006   15059   7  0.2  1.3 TS       -  19
  15006   15060   4  0.2  1.3 TS       -  19
  15006   15061   0  0.2  1.3 TS       -  19
  15006   15062   7  0.2  1.3 TS       -  19
  15006   15063   4  0.2  1.3 TS       -  19
  15006   15064   3  0.2  1.3 TS       -  19
  15006   15688   0  0.1  1.3 TS       -  19
  15006   15689   1  0.9  1.3 TS       -  19
  15006   15697   7  0.0  1.3 TS       -  19
  15006   15717   2  0.0  1.3 TS       -  19
  15006   15726   7  0.0  1.3 TS       -  19
  15006   15734   7  0.0  1.3 TS       -  19
  15006   15735   0  0.8  1.3 TS       -  19
  15006   15744   0  0.0  1.3 TS       -  19
  15006   15779   2  0.0  1.3 TS       -  19

This is an automatic backport of pull request #2509 done by [Mergify](https://mergify.com).

(cherry picked from commit 94e610a)

# Conflicts:
#	controller_manager/src/ros2_control_node.cpp
@mergify mergify Bot added the conflicts label Nov 14, 2025
@mergify

mergify Bot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor Author

Cherry-pick of 94e610a has failed:

On branch mergify/bp/humble/pr-2509
Your branch is up to date with 'origin/humble'.

You are currently cherry-picking commit 94e610a.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   controller_manager/src/ros2_control_node.cpp

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@christophfroehlich christophfroehlich deleted the mergify/bp/humble/pr-2509 branch November 14, 2025 21:27
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

Successfully merging this pull request may close these issues.

2 participants