-
Notifications
You must be signed in to change notification settings - Fork 463
Fix efa_mr_reg_impl/fa_mr_dereg_impl race condition #11786
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
base: main
Are you sure you want to change the base?
Conversation
include/ofi_atom.h
Outdated
| } \ | ||
| static inline \ | ||
| size_t ofi_atomic_inc_counter(ofi_atomic_counter *atomic) \ | ||
| { \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it be merged with ofi_atomic_inc/add/set/dec functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that can be done, but not so trivial. The way OFI_ATOMIC_DEFINE macro is implemented it does not have options for unsigned integer and memory model (following Windows model I guess). Therefore the macro definition is going to become extremely complex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm excluding the new define from this PR. Going to cut a new PR with better macros.
For the time being we can use signed integer ofi_atomic64_t.
a775e45 to
1643733
Compare
Convert ibv_mr_reg_ct and ibv_mr_reg_sz from plain size_t to ofi_atomic64_t to ensure thread-safe access in multi-threaded environments. This prevents race conditions when multiple threads register/deregister memory regions concurrently. Changes: - Use ofi_atomic_add64()/ofi_atomic_inc64() for MR registration - Use ofi_atomic_sub64()/ofi_atomic_dec64() for deregistration - Maintain existing logging functionality with atomic-safe reads Signed-off-by: Alexey Novikov <[email protected]>
1643733 to
5e9ab42
Compare
|
bot:aws:retest |
|
bot:aws:retest |
1 similar comment
|
bot:aws:retest |
ibv_mr_reg_ctandibv_mr_reg_sztoofi_atomic64