SPRADH0 August 2024 AM625 , AM6442 , AM69 , TDA4VM
When the IEC tasks are distributed over several
CPU cores, the processing of IEC tasks by priority is no longer guaranteed (see
Multicore). To prevent this situation, set the cpu affinity of all
CODESYS threads to a single core. Setting the cpu affinity can be accomplished using
the taskset -p <cpu core number (1 indexed)> <Process
ID>
command in the Linux shell.
This procedure is tested during a benchmarking on the AM64x by setting cpu affinity of all visible IEC tasks in htop to one core. However, every 4-5 minutes, there is still an increase of approximately 40% CPU load (see Figure 4-8) on the other core. During benchmark testing, the core containing the IEC tasks increases from ≅20% to ≅65% CPU load. Based on the increased CPU load, there can be additional threads in relation to the IEC tasks left running on the other core. The improvement in cycle time is difficult to track. That is, there are no obvious improvements to the cycle time observed.