-
Notifications
You must be signed in to change notification settings - Fork 60
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
freelist: add entry initialization/fini callbacks #831
Merged
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
72ced5e
to
6d96cac
Compare
rauteric
commented
Mar 27, 2025
6d96cac
to
930810b
Compare
bwbarrett
previously approved these changes
Mar 27, 2025
Add support to freelist for an optional callback for entry initialization. This will be called when an entry is allocated from memory, but not for subsequent `entry_alloc/entry_free`. This allows the callback to perform more expensive initialization of freelist entries that are not needed when the entry is simply reused. Signed-off-by: Eric Raut <eraut@amazon.com>
The fini function is not needed, as the init function does not allocate any memory Signed-off-by: Eric Raut <eraut@amazon.com>
Move a significant amount of initialization, including mutex allocation, to freelist callback. This means it will be done only once per entry memory allocation, instead of during each call to `allocate_req` (which is the critical path). Corresponding fini function also added. Signed-off-by: Eric Raut <eraut@amazon.com>
930810b
to
c8f531e
Compare
bwbarrett
approved these changes
Mar 27, 2025
AvivBenchorin
approved these changes
Mar 27, 2025
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.
Add support to freelist for an optional callback for entry
initialization. This will be called when an entry is allocated from
memory, but not for subsequent
entry_alloc/entry_free
.This allows the callback to perform more expensive initialization of
freelist entries that are not needed when the entry is simply reused.
Also use the callback in sendrecv and rdma protocols.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.