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

prov/shm: free all pending srx entries on ep close #10845

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aingerson
Copy link
Contributor

When an EP is closed, we may have rx_entries from the owner srx that still need to be freed. If we don't, the owner srx close may return an error since not all memory has been freed.

Matched inline, inject, CMA, and IPC transfers will all be freed immediately after matching but matched SAR messages that need multiple round trips need to be afreed asynchronously. Iterate through the sar_list and free the rx_entry with the owner srx if needed.

Unexpected messages are still assigned an rx_entry through the owner srx that needs to be freed. Add a list for all cmd_ctxs and free all outstanding unmatched rx_entries before closing.

When an EP is closed, we may have rx_entries from the owner srx that
still need to be freed. If we don't, the owner srx close may return an error
since not all memory has been freed.

Matched inline, inject, CMA, and IPC transfers will all be freed immediately
after matching but matched SAR messages that need multiple round trips need
to be afreed asynchronously. Iterate through the sar_list and free the rx_entry
with the owner srx if needed.

Unexpected messages are still assigned an rx_entry through the owner srx that
needs to be freed. Add a list for all cmd_ctxs and free all outstanding
unmatched rx_entries before closing.

Signed-off-by: Alexia Ingerson <alexia.ingerson@intel.com>
@aingerson aingerson requested a review from shijin-aws March 3, 2025 19:57
@aingerson
Copy link
Contributor Author

@shijin-aws Let me know if this isn't what you had in mind or if I missed a case!

while (!dlist_empty(&ep->unexp_cmd_list)) {
dlist_pop_front(&ep->unexp_cmd_list, struct smr_cmd_ctx,
cmd_ctx, entry);
ep->srx->owner_ops->free_entry(pend->rx_entry);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pend --> cmd_ctx

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops thanks!

@aingerson
Copy link
Contributor Author

@shijin-aws Can you share the AWS failure? it looks ok on our side

@sunkuamzn
Copy link
Contributor

@aingerson our CI had problems. This commit failed on a test that doesn't use SHM, so the commit is good.

@sunkuamzn
Copy link
Contributor

bot:aws:retest

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