-
-
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
_psutil_linux.get_process_cpu_affinity always throws OSError: [Errno 22] Invalid argument #522
Comments
The same happens with version 2.1.1:
|
Ping. |
Sorry, this totally slipped under my radar.
If that works for you as well it means psutil implementation is broken and On Fri, Aug 1, 2014 at 3:23 PM, Michał Łowicki [email protected]
Giampaolo - http://grodola.blogspot.com |
The same issue. |
OK, in that case I would recommend filing a bug on the Python bug tracker: On Fri, Aug 1, 2014 at 3:49 PM, Michał Łowicki [email protected]
Giampaolo - http://grodola.blogspot.com |
sched_getaffinity seems to work fine:
Do you control in psutil size of cpuset? Maybe it's related to it: EINVAL (sched_getaffinity() and, in kernels before 2.6.9, sched_setaffinity()) cpusetsize is smaller than the size of the affinity mask used by the kernel. |
When I do it as in psutil_proc_cpu_affinity_get:
I get:
I've replaced:
with
and seems to work fine. |
That does appear to be the issue. psutil_proc_cpu_affinity_get() is passing a long when the David Daeschler On Thu, Aug 7, 2014 at 7:28 AM, Michał Łowicki [email protected]
|
I just took a look at sched.h ( So maybe not an easy fix since it is a change in the return value from the David Daeschler On Thu, Aug 7, 2014 at 7:28 AM, Michał Łowicki [email protected]
|
Can you provide a patch? On Thu, Aug 7, 2014 at 4:33 PM, ddaeschler [email protected] wrote:
Giampaolo - http://grodola.blogspot.com |
Sure. I can take a look at this one over the weekend. David Daeschler On Thu, Aug 7, 2014 at 10:39 AM, giampaolo [email protected] wrote:
|
Patch attached. Tested and works on updated ubuntu VM. David Daeschler On Thu, Aug 7, 2014 at 10:39 AM, giampaolo [email protected] wrote:
|
@ddaeschler where I can find a patch? |
I forked and created a pull request which I think makes it easier to merge. I did attach the patch file to the email but it doesn't look like it makes David Daeschler On Sun, Aug 10, 2014 at 3:53 AM, Michał Łowicki [email protected]
|
Just committed the last change to the pull request that makes all CI tests pass. |
I'll take a look at this when I find some time (I'm going to Japan soon so I'm very short on time) but AFAICT it looks ok to merge. I'll just make sure this will work on python 2.4 as well. |
OK! The PR will be here when you get back. Enjoy your time in Japan. |
Thanks man.
|
Ping. |
Merged (finally). Sorry for waiting this long. |
…). Since OpenStack uses this version of psutil, we cannot use the latest version that solves this problem. Instead, we use other library, cpu-affinity, to get the CPU affinity
* Bugs in python-psutil Need to upgrade to package from jessie-backports in order to address the following issues: giampaolo/psutil#522 giampaolo/psutil#572 * Race when checking for processes It seems that is possible to query for a process that no longer exists. Handle that situation by ignoring it. * Wrong message when no processes are matches Not a problem at all, but handle that situation by printing a different message, just to be clear. * Filter out qemu-system-x86_64 processes that do not have Ceph disks For some reason, it seems that QEMU maps librados and librbd libraries even when not using them (ie NFS, DRBD). Add a function that parses the cmdline of each QEMU process, looks for disk drives, and by looking at the path, tells if we should check that process or not. Only check VMs with rbd and tapdev (Archipelago) disks. Also, split out process filtering stuff to a separate function.
I'm running Debian Wheezy and psutil 1.2.1
The text was updated successfully, but these errors were encountered: