-
Notifications
You must be signed in to change notification settings - Fork 431
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
UCT/CUDA_IPC: Use buffer id to detect VA recylcing #10405
base: master
Are you sure you want to change the base?
UCT/CUDA_IPC: Use buffer id to detect VA recylcing #10405
Conversation
arg1 = (const void *)&key->ph; | ||
arg2 = (const void *)®ion->key.ph; | ||
#endif | ||
if (memcmp(arg1, arg2, cmp_size) == 0) { |
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.
Does it makes sense to update the test to cover this behavior?
#if HAVE_CUDA_FABRIC | ||
cmp_size = sizeof(key->ph.buffer_id); | ||
arg1 = (const void *)&key->ph.buffer_id; | ||
arg2 = (const void *)®ion->key.ph.buffer_id; | ||
#else | ||
cmp_size = sizeof(key->ph); | ||
arg1 = (const void *)&key->ph; | ||
arg2 = (const void *)®ion->key.ph; | ||
#endif |
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.
- need to fix indent
- any reason to not compare buffer_id also for legacy, regardless of HAVE_CUDA_FABRIC?
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.
any reason to not compare buffer_id also for legacy, regardless of HAVE_CUDA_FABRIC?
I had this to begin with but key->ph
is of type CUipcMemHandle when HAVE_CUDA_FABRIC is not declared. So we would need to change the type if we want to also include buffer_id.
This PR solves the case where cuda reused pointer value (alloc/free/alloc), and failed to detect that it's actually not same allocation instance, right? |
Why/What?
Export handles are used for VA recycling check today but this is not guaranteed to be unique for newer memory allocators like VMM, and CUDA memory pools. We need to switch to using buffer_id attribute to perform this check.