-
Notifications
You must be signed in to change notification settings - Fork 20
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
issue: 3884801 Check for resident hugepages to avoid SIGBUS #204
base: vNext
Are you sure you want to change the base?
Conversation
if (rc < 0) { | ||
__log_info_dbg("mincore() failed to verify hugepages (errno=%d)", errno); | ||
} else if (resident_nr != pages_nr) { | ||
__log_info_dbg("Not all hugepages are resident (allocated=%zu resident=%zu)", |
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 guess we need to add it as info or at least some information that hugepages will not be used.
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.
higher level logic (xlio_allocator) iterates over available and suitable hugepage sizes in some order until allocation succeeds or all the hugepages fail. The warning message about falling back to regular pages is printed by xlio_allocator. So it's completely ok to fail here and try the next hugepage size.
cfce2e8
to
51c2340
Compare
In a containerized environment mmap() beyond the hugepages limit can be successful, but a further memory access triggers SIGBUS and terminates the process. Check that all the allocated hugepages are resident with mincore() to avoid the SIGBUS issue. Cost of the feature depends on the allocation size and hugepage size: - 32GB with 2MB pages takes 4400 us - 32GB with 1GB pages takes 11 us - 32MB with 2MB pages takes 5-6 us We expect a big memory preallocation at the start (2GB by default) and rare 32MB allocations during warmup period. Therefore, this feature can add several additional 5us latency spikes during warmup period. Signed-off-by: Dmytro Podgornyi <[email protected]>
b04003d
to
437bb39
Compare
Description
In a containerized environment mmap() beyond the hugepages limit can be successful, but a further memory access triggers SIGBUS and terminates the process. Check that all the allocated hugepages are resident with mincore() to avoid the SIGBUS issue.
Cost of the feature depends on the allocation size and hugepage size:
We expect a big memory preallocation at the start (2GB by default) and
rare 32MB allocations during warmup period. Therefore, this feature can
add several additional 5us latency spikes during warmup period.
What
Check for resident hugepages after allocation.
Why ?
Avoid SIGBUS in containerized environments.
Change type
What kind of change does this PR introduce?
Check list