Skip to main content
Associate
May 22, 2024
Question

STM32MP157F-EV1 - How to force all processes to run on Core 0?

  • May 22, 2024
  • 1 reply
  • 993 views

I'm attempting to run a critical process on Core 1 (A7 processor) while keeping all other processes on Core 0. I've had success with 'taskset' to get my critical process assigned to Core 1. I'm struggling with how to default all other processes to run on Core 0. 

Can someone show me how to do this on the supplied OpenSTLinux platform for this processor? The internet mentions isolcpus a lot but I'm not finding support for that command on this processor. How can it be done?

1 reply

Erwan SZYMANSKI
Technical Moderator
June 24, 2024

Hello @bgraham ,
Sorry for the delay, did you success to find a solution for your use case ? 

Kind regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
bgrahamAuthor
Associate
July 2, 2024

Not quite. The isolcpus command doesn't appear to be supported on OpenSTLinux, but CGroups appears to be. However, I am having issues writing the file which assigns members of my cpu_affinity group to Core 0. Maybe you could help? Here are my steps to reproduce the issue (all commands worked except for the last step which threw the error):

    • mount -o remount,rw /sys/fs/cgroup                                     //Re-mount /sys/fs/cgroup as a read/write directory:  
    • mkdir -p /sys/fs/cgroup/systemd/cpu_affinity/                 //Create a systemd subfolder for the new cpu_affinity cgroup:    
    • echo $$ > /sys/fs/cgroup/systemd/cpu_affinity/cgroup.procs              //Assign the current shell's PID (process ID) to the cpu_affinity CGroup under systemd. Since all child processes inherit their parent's CGroup settings, this effectively sets cpu_affinity as the default for all subsequently created processes.
    • echo "0" > /sys/fs/cgroup/systemd/cpu_affinity/cpuset.cpus      //Assign all processes in this group to core 0. This command results in the failure message below: 
      • -sh: can't create /sys/fs/cgroup/systemd/cpu_affinity/cpuset.cpus: Permission denied
      • Before you ask, YES, this directory has full read/write/execute permissions for all user levels