-
Notifications
You must be signed in to change notification settings - Fork 393
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
Define monitor unsubscribe_on_delete #10687
base: main
Are you sure you want to change the base?
Conversation
4ff05b7
to
20a72a4
Compare
Please add the new files to Windows build file list. |
ofi_monitor_unsubscribe(monitor, entry->info.iov.iov_base, | ||
entry->info.iov.iov_len, | ||
&entry->hmem_info); | ||
|
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 this be done within cache->delete_region()?
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.
It shouldn't. kdreg2 is designed to work with any provider. Putting this in delete_region() would result in the ofi_monitor_unsubscribe() being called for a specific provider delete_region() implementation.
In addition, ofi_monitor_subscribe() is called outside of cache->add_region(). Because of this, ofi_monitor_unsubscribe() should be called outside of cache->delete_region().
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.
That makes sense.
But the general architecture we have for the cache and monitors is to use callbacks, some of which may be set to a no-op. This is changing that to using a variable to adjust the flow. Maybe that's okay...
But in other places, ofi_monitor_subscribe/unsubscribe are called holding the mm_lock. Here, there are no locks being held.
Other memory monitors, such as CUDA, ROCR, and ZE, have a .c file for the implementation. This change cleans up the util_mem_monitor.c code by defining a uffd and import .c file, thus aligning to other memory monitor implementations. Signed-off-by: Mike Uttormark <mike.uttormark@hpe.com> Signed-off-by: Ian Ziemba <ian.ziemba@hpe.com>
Not all memory montiors have a 1-N relationship between subscribe and the MR cache entries. Some memory monitors, such as kdreg2, have a 1-1 relationship and require unsubscribe to be called when the corresponding MR cache entry is deleted. To meet this requirement, unsubscribe_on_delete is defined. When true for a memory monitor, ofi_monitor_unsubscribe() will be called on MR cache being freed. Signed-off-by: Mike Uttormark <mike.uttormark@hpe.com> Signed-off-by: Ian Ziemba <ian.ziemba@hpe.com>
20a72a4
to
8a4a4f7
Compare
Not all memory montiors have a 1-N relationship between subscribe and the MR cache entries. Some memory monitors, such as kdreg2, have a 1-1 relationship and require unsubscribe to be called when the corresponding MR cache entry is deleted.
To meet this requirement, unsubscribe_on_delete is defined. When true for a memory monitor, ofi_monitor_unsubscribe() will be called on MR cache being freed.