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

freelist: add entry initialization/fini callbacks #831

Merged
merged 3 commits into from
Mar 27, 2025

Conversation

rauteric
Copy link
Contributor

@rauteric rauteric commented 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.

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.

@rauteric rauteric changed the title Freelist init callback freelist: add entry initialization/fini callbacks Mar 27, 2025
@rauteric rauteric force-pushed the freelist-init-callback branch from 72ced5e to 6d96cac Compare March 27, 2025 02:29
@rauteric rauteric marked this pull request as ready for review March 27, 2025 02:29
@rauteric rauteric requested a review from a team as a code owner March 27, 2025 02:29
@rauteric rauteric force-pushed the freelist-init-callback branch from 6d96cac to 930810b Compare March 27, 2025 18:27
bwbarrett
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>
@rauteric rauteric merged commit 0210078 into aws:master Mar 27, 2025
23 checks passed
@rauteric rauteric deleted the freelist-init-callback branch March 27, 2025 23:29
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.

3 participants