Skip to content

Make coarse_alloc() return aligned address when alignment==0 #981

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

Conversation

ldorau
Copy link
Contributor

@ldorau ldorau commented Dec 9, 2024

Description

Make coarse_alloc() always return address aligned to coarse->page_size when alignment==0.

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly

Remove incorrect assert in utils_align_ptr_up_size_down().
A pointer is aligned, but a size is only adjusted to the new pointer.
The size does not have to be aligned.

Signed-off-by: Lukasz Dorau <[email protected]>
@ldorau ldorau requested a review from a team as a code owner December 9, 2024 10:29
@ldorau ldorau requested review from lplewa and bratpiorka December 9, 2024 10:30
@ldorau ldorau force-pushed the Make_coarse_alloc_return_aligned_address_when_alignment==0 branch from 7534c78 to 0fd7073 Compare December 9, 2024 11:49
@ldorau ldorau force-pushed the Make_coarse_alloc_return_aligned_address_when_alignment==0 branch 2 times, most recently from 9f65212 to 5d6a252 Compare December 9, 2024 12:13
Make coarse_alloc() always return address aligned to coarse->page_size
when alignment==0.

Signed-off-by: Lukasz Dorau <[email protected]>
Make UMF_COARSE_MEMORY_STRATEGY_FASTEST_BUT_ONE the default strategy,
because the alignment never equals 0 now.

Signed-off-by: Lukasz Dorau <[email protected]>
@ldorau ldorau force-pushed the Make_coarse_alloc_return_aligned_address_when_alignment==0 branch from 5d6a252 to efc620c Compare December 9, 2024 14:48
@ldorau ldorau mentioned this pull request Dec 9, 2024
10 tasks
@ldorau
Copy link
Contributor Author

ldorau commented Dec 10, 2024

@bratpiorka please review

@ldorau
Copy link
Contributor Author

ldorau commented Dec 10, 2024

@bratpiorka It should be merged before #976

@ldorau ldorau force-pushed the Make_coarse_alloc_return_aligned_address_when_alignment==0 branch from efc620c to 62496ed Compare December 10, 2024 10:42
@ldorau ldorau merged commit 1f695ad into oneapi-src:main Dec 10, 2024
8 of 70 checks passed
@ldorau ldorau deleted the Make_coarse_alloc_return_aligned_address_when_alignment==0 branch December 10, 2024 10:58
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.

3 participants