Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MatiasElo
Copy link
Collaborator

@MatiasElo MatiasElo commented Feb 25, 2025

V2:

  • Dropped validation test change commit

@odpbuild odpbuild changed the title api: system: allow odp_system_meminfo_t.total_overhead to be zero [PATCH v1] api: system: allow odp_system_meminfo_t.total_overhead to be zero Feb 25, 2025
@@ -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)
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

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
Copy link
Collaborator

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.

Copy link
Collaborator Author

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]>
@odpbuild odpbuild changed the title [PATCH v1] api: system: allow odp_system_meminfo_t.total_overhead to be zero [PATCH v2] api: system: allow odp_system_meminfo_t.total_overhead to be zero Feb 27, 2025
@MatiasElo MatiasElo added this to the API Next milestone Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants