-
Notifications
You must be signed in to change notification settings - Fork 35
enable tracker in ProxyLib by default #761
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
enable tracker in ProxyLib by default #761
Conversation
c6c79fb
to
3636263
Compare
Just to note it here: As we agreed yesterday, the proxy lib should ON the memory tracker for the proxy pool. In general memory tracker (as an essential part of UMF) should be always ON. For the use cases when tracking should be disabled for some reasons the |
8393472
to
96e05e8
Compare
96e05e8
to
1a7c33e
Compare
10a5b7f
to
722ad17
Compare
b61e0bf
to
0c0e480
Compare
0c0e480
to
180b06b
Compare
5d76c37
to
9603d32
Compare
dd22268
to
569a2c0
Compare
@bratpiorka Rebase please |
6ddabc9
to
536b05b
Compare
src/provider/provider_tracking.c
Outdated
LOG_DEBUG("allocated %p, provider: %p, size: %zu", *ptr, | ||
(void *)p->hUpstream, size); | ||
|
||
// check if the allocation was already added to the tracker |
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.
this logic is not needed anymore, right?
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.
right, removed
536b05b
to
ac7a88f
Compare
test/ipc_os_prov_proxy.c
Outdated
size_t nbytes = 1; | ||
char *found = NULL; | ||
while (nbytes > 0 && found == NULL) { | ||
memset(buf, 0, nbytes); // erase previous data |
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.
You should erase the whole buf
: nbytes
-> size_buf
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.
Verified - it was fixed.
test/ipc_os_prov_proxy.c
Outdated
char *found = NULL; | ||
while (nbytes > 0 && found == NULL) { | ||
memset(buf, 0, nbytes); // erase previous data | ||
nbytes = read(fd, buf, size_buf); |
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.
Check for a read error: nbytes == -1
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.
Verified - it was fixed.
size_t size = 2137; | ||
void *ptr = malloc(size); | ||
if (ptr == NULL) { | ||
ret = -1; |
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.
Print an error
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.
done
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.
Verified.
test/ipc_os_prov_proxy.c
Outdated
} | ||
|
||
fprintf(stderr, "Allocated memory - %zu\n", size); | ||
unsigned long long val = 144; |
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.
Why not using size_t
?
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.
Verified - it was fixed.
if(UMF_PROXY_LIB_ENABLED | ||
AND NOT UMF_LINK_HWLOC_STATICALLY | ||
AND NOT UMF_DISABLE_HWLOC) | ||
if(UMF_PROXY_LIB_ENABLED) |
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.
AND UMF_BUILD_SHARED_LIBRARY?
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.
UMF_PROXY_LIB_ENABLED is set only in shared library mode, see https://github.com/oneapi-src/unified-memory-framework/pull/761/files#diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20aR439
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.
Verified.
test/ipc_os_prov_proxy.c
Outdated
|
||
// read the "/proc/self/maps" file until the "libumf_proxy.so" of the maps | ||
// is found or EOF is reached. | ||
const size_t size_buf = 8192; |
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.
nit: uppercase constant
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.
done
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.
Verified.
test/ipc_os_prov_proxy.c
Outdated
ssize_t len = | ||
send(producer_socket, &ipc_handle_size, sizeof(ipc_handle_size), 0); | ||
if (len < 0) { | ||
fprintf(stderr, "[producer] ERROR: unable to send the message\n"); |
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.
More descriptive: unable to send the ipc_handle_size to the consumer?
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.
done
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.
Verified.
test/ipc_os_prov_proxy.c
Outdated
|
||
// send the ipc_handle of ipc_handle_size to the consumer | ||
if (send(producer_socket, ipc_handle, ipc_handle_size, 0) < 0) { | ||
fprintf(stderr, "[producer] ERROR: unable to send the message\n"); |
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.
More descriptive: unable to send the ipc_handle to the consumer?
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.
done
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.
Verified.
ac7a88f
to
09ee70e
Compare
Description
Enable Tracking Provider in the Proxy Lib by default.
Checklist