find_rt_cpu_number() Error in uspace_rtapi_app.cc on PREEMPT_RT

More
14 Jan 2025 02:05 #318916 by WonderOwl
Hi, I am new to LinuxCNC and have some questions about how LinuxCNC find the RT CPU (isolate CPU core) on PREEMPT_RT.
It seems the find_rt_cpu_number() function in uspace_rtapi_app.cc either choose the environment variable RTAPI_CPU_NUMBER (which is NULL if not set manually) or choose the last CPU core regardless of whether there is an isolated core.
e.g. The isolate core on my Preempt_RT is core 1, but find_rt_cpu_number() returns 3 and the RT thread is running on core3 in the attached images.

My test version is LINUXCNC - 2.10.0~pre0. Thx for your time :-D

 
Attachments:

Please Log in or Create an account to join the conversation.

More
17 Jan 2025 18:37 #319203 by andypugh
This isn't an answer to your question, but it looks like you can override it with an environment variable:
github.com/LinuxCNC/linuxcnc/blob/master...ce_rtapi_app.cc#L984
It might be interesting in your case to do that and see if latency improves.

Are you using Linux and not BSD or similar? (I see a comment about it only working with Linux in one of the commits.

Otherwise, looking at the code, I have no idea how it works, it looks very odd.

Please Log in or Create an account to join the conversation.

More
17 Jan 2025 23:52 #319233 by Grotius
At line 996.
sysconf(_SC_NPROCESSORS_ONLN)
call to retrieve the number of available CPUs

at line 1006. It runs over the cpu list.
then it sets the priority 0-100% for each used cpu.

 

Please Log in or Create an account to join the conversation.

Time to create page: 0.055 seconds
Powered by Kunena Forum