-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Improve / refactor anonymous mmap capabilities #10810
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Summary: The motivation for this change is a planned feature (related to HyperClockCache) that will depend on a large array that can essentially grow automatically, up to some bound, without the pointer address changing and with guaranteed zero-initialization of the data. Anonymous mmaps provide such functionality, and this change provides an internal API for that. The other existing use of anonymous mmap in RocksDB is for allocating in huge pages. That code and other related Arena code used some awkward non-RAII and pre-C++11 idioms, so I cleaned up much of that as well, with RAII, move semantics, constexpr, etc. More specifcs: * Minimize conditional compilation * Add Windows support for anonymous mmaps * Use std::deque instead of std::vector for more efficient bag Test Plan: unit test added for new functionality
@pdillinger has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
riversand963
approved these changes
Oct 14, 2022
@pdillinger has updated the pull request. You must reimport the pull request before landing. |
@pdillinger has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
pdillinger
added a commit
to pdillinger/rocksdb
that referenced
this pull request
Nov 28, 2022
Summary: Because of unexpected / unvalidated changes in memory usage associated with facebook#10810 Test Plan: CI Reviewers: Subscribers: Tasks: Tags:
pdillinger
added a commit
that referenced
this pull request
Nov 28, 2022
This reverts commit 8367f0d.
pdillinger
added a commit
to pdillinger/rocksdb
that referenced
this pull request
Nov 29, 2022
Summary: Partial revert of facebook#10810 to go back to using new char[] directly and track raw pointers. Test Plan:
pdillinger
added a commit
that referenced
this pull request
Dec 1, 2022
This reverts commit 8367f0d.
pdillinger
added a commit
to pdillinger/rocksdb
that referenced
this pull request
Dec 1, 2022
Summary: The change to `make_unique<char[]>` in facebook#10810 inadvertently started initializing data in Arena blocks, which could lead to increased memory use due to (at least on our implementation) force-mapping pages as a result. This goes back to `new char[]` while keeping all the other good parts of facebook#10810. Test Plan: unit test added (fails on Linux before fix)
facebook-github-bot
pushed a commit
that referenced
this pull request
Dec 1, 2022
Summary: The change to `make_unique<char[]>` in #10810 inadvertently started initializing data in Arena blocks, which could lead to increased memory use due to (at least on our implementation) force-mapping pages as a result. This change goes back to `new char[]` while keeping all the other good parts of #10810. Pull Request resolved: #11012 Test Plan: unit test added (fails on Linux before fix) Reviewed By: anand1976 Differential Revision: D41658893 Pulled By: pdillinger fbshipit-source-id: 267b7dccfadaeeb1be767d43c602a6abb0e71cd0
seckcoder
added a commit
to rockset/rocksdb-cloud
that referenced
this pull request
Jul 21, 2023
…ook#10810)"" This reverts commit e0cf5cd.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary: The motivation for this change is a planned feature (related to HyperClockCache) that will depend on a large array that can essentially grow automatically, up to some bound, without the pointer address changing and with guaranteed zero-initialization of the data. Anonymous mmaps provide such functionality, and this change provides an internal API for that.
The other existing use of anonymous mmap in RocksDB is for allocating in huge pages. That code and other related Arena code used some awkward non-RAII and pre-C++11 idioms, so I cleaned up much of that as well, with RAII, move semantics, constexpr, etc.
More specifcs:
Test Plan: unit test added for new functionality