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.
Here is a PR that adds to Mooshika some kind of support for applications that forks.
It adds two things:
msk_fork_init() : an helper that exposes ibv_fork_init() in the Mooshika API
msk_lib_reset() : a function a process can call to reset the library global state (to be called by child process after fork())
mks_lib_reset() doesn't free the rdma resources that may have been allocated by parent and haven't been freed before fork (they are leaked in the child process), but prevents some leaks, hangs and crashes if the process doesn't exec() after fork(). It is a "better than nothing" solution.
msk_reset_lib() also calls Mellanox-specific routine rdma_lib_reset() to reset librdmacm state if Mooshika has been compiled with Mellanox's librdmacm.
In our product (IO interception via a LD_PRELOAD'ed library and redirection to a proxy via IB), we need these interfaces, because we don't know in advance what is the behavior of the processes we're instrumenting. We don't if they will fork() or not, and we must be prepared for this case.