-
-
Notifications
You must be signed in to change notification settings - Fork 31.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
bpo-32941: Add madvise() for mmap objects #6172
Conversation
Allow mmap objects to access the madvise() system call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this! I left a couple comments that need to be addressed.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase And if you don't make the requested changes, you will be put in the comfy chair! |
Over at numpy/numpy#13172, it became clear that having this would be very useful for |
Might also be useful for multiprocessing. @applio |
I will make the requested changes. @pitrou, thank you for the review, and I'm sorry for the enormous delay. |
Allow lengths greater than self->size. Add docs for MADV_* Constants.
I have made the requested changes; please review again. I have also added a sentence to the docs explaining that start must be a multiple of the PAGESIZE. |
Thanks for making the requested changes! @pitrou: please review the changes made to this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! A few nits below, otherwise the PR looks good to me.
return NULL; | ||
} | ||
if (length <= 0) { | ||
PyErr_SetString(PyExc_ValueError, "madvise length invalid"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here as well: perhaps "madvise length must be > 0"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, Linux madvise() allows length to be 0 (according to its manpage).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I'm not sure why one would pass a length of zero. I think it's okay to change the check to length < 0
, though.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
(also, please ensure you rebase or merge from master and fix conflicts) |
Allow a length of 0.
Thanks, @pitrou. I have made the requested changes; please review again. |
Thanks for making the requested changes! @pitrou: please review the changes made to this pull request. |
@pitrou Ping. I would like to get this merged. |
Yes, I'm taking a final look this evening. |
Thank you @ZackerySpytz :-) |
|
|
Interesting. It seems PPC64 has a 64kB page size. @vstinner What is the procedure to test a quick fix on a buildbot without going through Github? Edit: I found the answer. |
Fix at #13596 |
Allow mmap objects to access the madvise() system call.
Allow mmap objects to access the madvise() system call.
https://bugs.python.org/issue32941