Closed JakkuSakura closed 4 years ago
Interesting. Do you know if cgroups or CPU affinity has been set for the process?
For the logical CPUs, num_cpus checks sched_getaffinity
, and if that fails, it checks _SC_NPROCESSORS_ONLN
.
Oh, I forgot that I have already isolated 3 cores for my realtime application using tuned
. Is there an option to get the real logical core number?
Nope. num_cpus assumes if you're asking for the number of logical CPUs, you're likely asking how many the process has access to.
A simple wrap for num_cpus and lstopo