Skip to content
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

Add Mmap.madvise! #37369

Merged
merged 3 commits into from
Oct 1, 2020
Merged

Add Mmap.madvise! #37369

merged 3 commits into from
Oct 1, 2020

Conversation

jmert
Copy link
Contributor

@jmert jmert commented Sep 3, 2020

This PR adds Mmap.madvise! to give access to the madvise system calls on unix OSs.

I've done my best to fill in the list of OS-specific constants, but I only have a Linux machine locally from which I could extract the values from appropriate header files — for everything else, I relied on finding headers through Google searches.

Resolves #37353.

@jmert jmert force-pushed the madvise branch 2 times, most recently from 78f66de to 2c374a0 Compare September 3, 2020 03:59
@jmert jmert changed the title Add Mmap.madvise Add Mmap.madvise! Sep 5, 2020
@jmert
Copy link
Contributor Author

jmert commented Sep 8, 2020

I've been testing this out, and while there aren't any issues, it also doesn't do what I actually want. It appears the MADV_WILLNEED flag is not akin to a late-advisory equivalent of MAP_POPULATE during the initial mmap call.[1] So while I'm still willing to do any revisions reviewers may want on this PR, it's not personally urgent to my work. (Instead it looks like I need to look into a nice way to get more flags through to mmap itself.)

[1] There was proposal from 2013 to the Linux kernel mailing list to add a MADV_POPULATE which would have done what I wanted, but that appears to have long been abandoned so is no help to me.

@StefanKarpinski StefanKarpinski added the triage This should be discussed on a triage call label Sep 28, 2020
@JeffBezanson JeffBezanson merged commit 98d1300 into JuliaLang:master Oct 1, 2020
@JeffBezanson JeffBezanson removed the triage This should be discussed on a triage call label Oct 1, 2020
@jmert jmert deleted the madvise branch October 1, 2020 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding madvise to the Mmap stdlib
3 participants