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 committing back to mmap-alloc on Linux/Mac with madvise/MADV_WILLNEED? #151

Closed
joshlf opened this issue Feb 23, 2018 · 1 comment
Closed

Comments

@joshlf
Copy link
Collaborator

joshlf commented Feb 23, 2018

We currently don't provide the commit method on mmap-alloc's MapAlloc on Linux and Mac because pages are always committed dynamically when they are first accessed (whereas, on Windows, accessing an uncommitted page will cause a runtime fault).

However, on Linux, we do allow MapAlloc to be configured to commit memory that it allocates by passing the MAP_POPULATE flag to mmap. Thus, perhaps it would be appropriate by to provide a commit method that is backed by a call to madvise with its equivalent flag, MADV_WILLNEED? It provides essentially the same guarantees as MAP_POPULATE (namely, it's only a hint to the kernel and it doesn't change any observable behavior other than possibly performance), which we already provide via the commit configuration.

Thoughts?

@joshlf
Copy link
Collaborator Author

joshlf commented Feb 23, 2018

Talked to @ezrosent about this offline; decided to move forward with it.

joshlf added a commit that referenced this issue Feb 23, 2018
- Add large-align feature, allowing alignments larger than a page
  size
- Allow memory to be explicitly committed on Linux and Mac
- Allow memory to be committed on allocation on Mac
- Improve documentation around committed/uncommitted memory
- Closes #151
joshlf added a commit that referenced this issue Feb 23, 2018
- Add large-align feature, allowing alignments larger than a page
  size
- Allow memory to be explicitly committed on Linux and Mac
- Allow memory to be committed on allocation on Mac
- Improve documentation around committed/uncommitted memory
- Closes #151
joshlf added a commit that referenced this issue Feb 26, 2018
- Add large-align feature, allowing alignments larger than a page
  size
- Allow memory to be explicitly committed on Linux and Mac
- Allow memory to be committed on allocation on Mac
- Improve documentation around committed/uncommitted memory
- Closes #151
joshlf added a commit that referenced this issue Mar 16, 2018
- Add large-align feature, allowing alignments larger than a page
  size
- Allow memory to be explicitly committed on Linux and Mac
- Allow memory to be committed on allocation on Mac
- Improve documentation around committed/uncommitted memory
- Closes #151
joshlf added a commit that referenced this issue Mar 16, 2018
- Add large-align feature, allowing alignments larger than a page
  size
- Allow memory to be explicitly committed on Linux and Mac
- Allow memory to be committed on allocation on Mac
- Improve documentation around committed/uncommitted memory
- Closes #151
joshlf added a commit that referenced this issue Mar 16, 2018
- Add large-align feature, allowing alignments larger than a page
  size
- Allow memory to be explicitly committed on Linux and Mac
- Allow memory to be committed on allocation on Mac
- Improve documentation around committed/uncommitted memory
- Closes #151
joshlf added a commit that referenced this issue Mar 16, 2018
- Add large-align feature, allowing alignments larger than a page
  size
- Allow memory to be explicitly committed on Linux and Mac
- Allow memory to be committed on allocation on Mac
- Improve documentation around committed/uncommitted memory
- Closes #151
joshlf added a commit that referenced this issue Mar 17, 2018
- Add large-align feature, allowing alignments larger than a page
  size
- Allow memory to be explicitly committed on Linux and Mac
- Allow memory to be committed on allocation on Mac
- Improve documentation around committed/uncommitted memory
- Closes #151
joshlf added a commit that referenced this issue Mar 17, 2018
- Add large-align feature, allowing alignments larger than a page
  size
- Allow memory to be explicitly committed on Linux and Mac
- Allow memory to be committed on allocation on Mac
- Improve documentation around committed/uncommitted memory
- Closes #151
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant