Skip to content

Add flag to force XDP umem hugepage allocation - #2145

Merged
camshaft merged 5 commits into
aws:mainfrom
ollie-etl:hugepage-support
Mar 14, 2024
Merged

Add flag to force XDP umem hugepage allocation#2145
camshaft merged 5 commits into
aws:mainfrom
ollie-etl:hugepage-support

Conversation

@ollie-etl

@ollie-etl ollie-etl commented Mar 6, 2024

Copy link
Copy Markdown
Contributor

Description of changes:

Modifies the XDP Umem builder to include a new flag hugepage, which when set, sets the MAP_HUGETLB flag in the mmap syscall.

Umem is required to be backed by a hugepage, but the current allocation method doesn't guaranteed that, it relies on kernel transparent huge-pages, and if none is available, silently falls back to a none hugepage allocation. This new flag forces hugepage allocation, and will fail if none is avilable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ollie-etl ollie-etl changed the title Add flag to force umem hugepage allocation Add flag to force XDP umem hugepage allocation Mar 6, 2024
@camshaft

Copy link
Copy Markdown
Contributor

This PR needs to be rebased as well. It also looks like you need to run cargo fmt, since there's some formatting issues with the changes.

@ollie-etl

Copy link
Copy Markdown
Contributor Author

@camshaft the failing test seems unrelated (flaky test)

Comment thread tools/xdp/s2n-quic-xdp/src/mmap.rs Outdated
Comment thread tools/xdp/s2n-quic-xdp/src/mmap.rs Outdated

#[derive(Debug)]
pub enum MmapOptions {
None,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this option actually needed if the functions take an Option already?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Completely correct. Fixed

@camshaft
camshaft merged commit 2d4df73 into aws:main Mar 14, 2024
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