-
Notifications
You must be signed in to change notification settings - Fork 35
Do not ignore error in os_free() when size == 0 #482
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
Do not ignore error in os_free() when size == 0 #482
Conversation
786689a
to
93f94a9
Compare
93f94a9
to
2bbd9fc
Compare
benchmark/ubench.c
Outdated
@@ -196,6 +196,7 @@ UBENCH_EX(simple, proxy_pool_with_os_memory_provider) { | |||
} | |||
|
|||
umf_memory_pool_handle_t proxy_pool; | |||
// the proxy pool requires the tracking provider to work correctly |
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.
The tracking provider is always required to work correctly :)
Would you like to say that tracking capabilities should be ON?
My general thoughts: the amount of features that depend on tracking capabilities is increasing. We should consider making the tracking provider always ON (remove the option that allows to disable it) or we need to check it at build/run time and return appropriate error. I vote for the first option (always unconditional ON).
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 agree. Done: #485
benchmark/ubench.c
Outdated
@@ -238,8 +239,10 @@ UBENCH_EX(simple, disjoint_pool_with_os_memory_provider) { | |||
disjoint_memory_pool_params.MinBucketSize = DISJOINT_POOL_MIN_BUCKET_SIZE; | |||
|
|||
umf_memory_pool_handle_t disjoint_pool; | |||
umf_result = umfPoolCreate(umfDisjointPoolOps(), os_memory_provider, | |||
&disjoint_memory_pool_params, 0, &disjoint_pool); | |||
// disable the tracking provider to make it work faster (UMF_POOL_CREATE_FLAG_DISABLE_TRACKING) |
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.
Are we interested in performance without a tracking provider? But in real workloads tracking capabilities will be ON?
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.
Done.
@@ -343,6 +348,15 @@ static umf_result_t trackingFree(void *hProvider, void *ptr, size_t size) { | |||
umf_ba_global_free(value); | |||
} | |||
|
|||
// umfMemoryProviderFree() should not be called with 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.
But according to this PR umfMemoryProviderFree()
for tracking provider can be called with size == 0
.
Maybe a particular pool implementation should explicitly get the size from the tracker and call umfMemoryProviderFree()
with the right size?
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. New fix: #487
Signed-off-by: Lukasz Dorau <[email protected]>
umfMemoryProviderFree() should not be called with size == 0, so use the size saved in the tracking provider in this case. Signed-off-by: Lukasz Dorau <[email protected]>
Ref: oneapi-src#475 Ref: oneapi-src#481 Signed-off-by: Lukasz Dorau <[email protected]>
2bbd9fc
to
657b704
Compare
Replaced with #487 |
Description
Do not ignore error in
os_free()
when size == 0.Ref: #481
Checklist