-
Notifications
You must be signed in to change notification settings - Fork 135
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
[PATCH v2] api: system: allow odp_system_meminfo_t.total_overhead to be zero #2184
base: master
Are you sure you want to change the base?
Conversation
test/validation/api/system/system.c
Outdated
@@ -277,7 +277,8 @@ static void system_test_meminfo(void) | |||
CU_ASSERT(ret == ret_0); | |||
CU_ASSERT(info_0.total_mapped == info.total_mapped); | |||
CU_ASSERT(info_0.total_used == info.total_used); | |||
CU_ASSERT(info_0.total_overhead == info.total_overhead); | |||
if (info_0.total_overhead) |
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 condition does not seem necessary. Even if total_overhead is not supported, its value (zero in that case) should be the same in the two calls.
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.
What I was thinking here was that an implementation could still fill total_overhead
when it has to read the per memory block info anyways. But now thinking about it, perhaps it's not the cleanest if the field value depends on other parameters.
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 "zero if not supported by the implementation" text in the API makes me think that if total overhead count is supported, then it is returned in all calls. If it might be zero also (e.g.) when the return value is less than the num parameter, then I think the API probably should mention it.
@@ -1,6 +1,6 @@ | |||
/* SPDX-License-Identifier: BSD-3-Clause |
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.
Typo in commit message: debuggin.
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.
Fixed in V2.
For some implementations it may not be always feasible to fill odp_system_meminfo_t.total_overhead value. As this field is only intended for debugging purposes, allow implementations to return zero in this field. Signed-off-by: Matias Elo <[email protected]> Reviewed-by: Janne Peltonen <[email protected]>
0a8a405
to
c9433e1
Compare
V2: