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

Memory leak fixes #2001

Merged
merged 3 commits into from
Feb 17, 2024
Merged

Memory leak fixes #2001

merged 3 commits into from
Feb 17, 2024

Conversation

francescolavra
Copy link
Member

This changeset fixes memory leaks that have been discovered while load-testing mysql with HammerDB (#1999).

destruct_context() is an arch-specific function that undoes what
init_context_machine() does; failure to call this function before
deallocating a kernel context leaks the memory allocated by
init_context_machine().
A process context retrieved via a get_process_context() call has an
initial refcount value of 1; if the refcount is not decremented in
the relevant completion closure, the context will never be returned
to the free list, nor deallocated.
This change adds a context field to the aio_complete and
aio_eventfd_complete closures, so that the process context can be
properly released.
A process context retrieved via a get_process_context() call has an
initial refcount value of 1; if the refcount is not decremented
when the async operations triggered by io_uring_enter() are
completed, the context will never be returned to the free list, nor
deallocated.
This change adds a context field to the iour_rw_complete and
iour_close_complete closures, so that the process context can be
properly released.
@francescolavra francescolavra merged commit 512c298 into master Feb 17, 2024
5 checks passed
@francescolavra francescolavra deleted the fix/memleak branch February 17, 2024 08:19
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.

1 participant