-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpu-affinity test fail on Archlinux #956
Comments
Mmm..... I'm not sure what you're suggesting as a fix. |
I pushed a small change that attempts to set the affinity to the value listed under |
Can you show me what happens if you try to set a non eligible CPU?
...and this:
...and show me the exception? |
Digging through the kernels source, the cpumask will accept a new mask so long as there is an intersection with the present cpus. So setting affinity to just one invalid will throw the
and:
Where as:
Both are fine. My suggestion was to parse out I don't think this is great but it was the closest to how you currently have the test. The other option is you could parse out |
Considering that CPU affinity on Linux should be determined at runtime I would say this is not an issue with the test per se but something which requires a brand new functionality. |
Running
Archlinux
kernel4.8.13-1
with the latest versions ofPython
3.6.0
andpsutil
5.1.0
:The test value for
cpus_allowed
is being read from/proc/$/status
and where as I have the kernel configured withCONFIG_HOTPLUG_CPU=y
set.From
cpuset.h
:It would seem that if cpu-hotplugging is enabled this value is the mask with all the bits flipped by default at boot-time, even if they're non-existent.
FWIW, if you call
psutil.cpu_affinity(cpus_allowed)
wherecpus_allowed
is a list of cpus fromstatus
. After this call, the correct value is listed instatus
, where it goes from say[0-7]
to[0-3]
.The text was updated successfully, but these errors were encountered: