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

UCS/RCACHE: Add support for dynamic region alignment #9441

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

Artemy-Mellanox
Copy link
Contributor

Why ?

Some transports (e.g. gdrcopy) require special alignment.

How ?

Regions in the UCP rcache will select the maximum alignment from the MD registrations they comprise. When merging regions, the rcache will also choose the maximum alignment.

src/ucp/core/ucp_mm.c Outdated Show resolved Hide resolved
src/ucs/memory/rcache.c Outdated Show resolved Hide resolved
src/ucs/memory/rcache.c Outdated Show resolved Hide resolved
test/gtest/ucs/test_rcache.cc Show resolved Hide resolved
@Artemy-Mellanox Artemy-Mellanox force-pushed the topic/rcache_align branch 3 times, most recently from 878e7fd to 8b93a57 Compare October 29, 2023 07:45
src/ucp/core/ucp_mm.c Outdated Show resolved Hide resolved
src/ucp/core/ucp_mm.inl Outdated Show resolved Hide resolved
ucs_list_head_init(&region_list);
ucs_rcache_find_regions(rcache, *start, old_start, &region_list);
ucs_rcache_find_regions(rcache, *start, old_start - 1, &region_list);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why changed to -1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ucs_rcache_find_regions() expects an inclusive end, see other uses.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we write the code as while loop that stops when the list of overlapping regions is empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we always can replace goto with do {...} while(!list_empty)
do we want to avoid traversing regions we already cleaned as we do here?

src/ucs/memory/rcache.inl Show resolved Hide resolved
src/ucs/memory/rcache.c Outdated Show resolved Hide resolved
ucs_list_head_init(&region_list);
ucs_rcache_find_regions(rcache, *start, old_start, &region_list);
ucs_rcache_find_regions(rcache, *start, old_start - 1, &region_list);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we write the code as while loop that stops when the list of overlapping regions is empty?

src/ucs/memory/rcache.c Outdated Show resolved Hide resolved
@@ -402,7 +402,7 @@ UCS_MT_TEST_F(test_rcache, merge, 6) {
munmap(mem, size1 + pad + size2);
}

UCS_MT_TEST_F(test_rcache, merge_aligned, 6)
UCS_TEST_F(test_rcache, merge_aligned)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why changed?

@yosefe yosefe enabled auto-merge November 7, 2023 13:50
@yosefe yosefe merged commit 0f9f185 into openucx:master Nov 8, 2023
115 checks passed
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