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

runtime-rs: enable hugepage #5601

Merged
merged 2 commits into from
Dec 25, 2022
Merged

Conversation

Tim-0731-Hzt
Copy link
Member

@Tim-0731-Hzt Tim-0731-Hzt commented Nov 7, 2022

enable the functionality of using hugepages in container

Fixes: #5560
Signed-off-by: Zhongtao Hu [email protected]

@Tim-0731-Hzt Tim-0731-Hzt added do-not-merge PR has problems or depends on another wip Work in Progress (PR incomplete - needs more work or rework) runtime-rs labels Nov 7, 2022
@Tim-0731-Hzt Tim-0731-Hzt changed the title Hugepage runtime-rs: enable Hugepage Nov 7, 2022
@Tim-0731-Hzt Tim-0731-Hzt changed the title runtime-rs: enable Hugepage runtime-rs: enable hugepage Nov 7, 2022
@katacontainersbot katacontainersbot added the size/large Task of significant size label Nov 7, 2022
Tim-0731-Hzt added a commit to Tim-0731-Hzt/tests that referenced this pull request Nov 7, 2022
Tim-0731-Hzt added a commit to Tim-0731-Hzt/tests that referenced this pull request Nov 8, 2022
Tim-0731-Hzt added a commit to Tim-0731-Hzt/tests that referenced this pull request Nov 8, 2022
@Tim-0731-Hzt Tim-0731-Hzt force-pushed the hugepage branch 4 times, most recently from a35cab8 to b48c557 Compare November 10, 2022 02:53
@Tim-0731-Hzt Tim-0731-Hzt removed do-not-merge PR has problems or depends on another wip Work in Progress (PR incomplete - needs more work or rework) labels Nov 10, 2022
Copy link
Contributor

@xyjixyjixyji xyjixyjixyji left a comment

Choose a reason for hiding this comment

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

Generally LGTM, but some parts need to be edited.

@Tim-0731-Hzt Tim-0731-Hzt force-pushed the hugepage branch 2 times, most recently from e7fae46 to 78b3178 Compare November 11, 2022 04:00
@Tim-0731-Hzt Tim-0731-Hzt force-pushed the hugepage branch 2 times, most recently from 1d13836 to b85eb93 Compare November 28, 2022 08:02
Tim-0731-Hzt added a commit to Tim-0731-Hzt/tests that referenced this pull request Nov 28, 2022
@Tim-0731-Hzt
Copy link
Member Author

/test

Copy link
Contributor

@quanweiZhou quanweiZhou left a comment

Choose a reason for hiding this comment

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

This patch contains 2 parts, I suggest splitting it into 2 commit

  1. VMM's hugepage.
  2. container's hugepage.

@Tim-0731-Hzt
Copy link
Member Author

/test

@Tim-0731-Hzt
Copy link
Member Author

/test-arm

support vm hugepage,set the hugetlbfs mount point as vm  memory path

Fixes:kata-containers#5560
Signed-off-by: Zhongtao Hu <[email protected]>
@Tim-0731-Hzt
Copy link
Member Author

/test

Copy link
Contributor

@YushuoEdge YushuoEdge left a comment

Choose a reason for hiding this comment

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

LGTM!

@Tim-0731-Hzt
Copy link
Member Author

/test

Copy link
Member

@studychao studychao left a comment

Choose a reason for hiding this comment

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

@Tim-0731-Hzt Thanks, Zhongtao. A few comments.

}
}

pub(crate) fn get_huge_page_option(m: &oci::Mount) -> Result<Option<Vec<String>>> {
Copy link
Member

Choose a reason for hiding this comment

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

If the hugetlbfs mount point is not mounted, will runtime help do that?

Copy link
Member

Choose a reason for hiding this comment

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

or do we assume that when users are using this feature, they have already set up the environment for hugetlbfs?

Copy link
Member Author

@Tim-0731-Hzt Tim-0731-Hzt Dec 12, 2022

Choose a reason for hiding this comment

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

Yes, we assume the users will set up the environment for hugetlbfs. Because kubernetes will be responsible to check the environment on the host. So, if it isn't mounted, it will fail in kubelet.

impl Hugepage {
pub(crate) fn new(
mount: &oci::Mount,
hugepage_limits_map: HashMap<Byte, u64>,
Copy link
Member

Choose a reason for hiding this comment

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

Also, why use Byte here? I see in go version it is using str

Copy link
Member Author

@Tim-0731-Hzt Tim-0731-Hzt Dec 12, 2022

Choose a reason for hiding this comment

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

I think Byte is more straightforward for page size, compared with str.

enable the functionality of using hugepages in container

Fixes: kata-containers#5560
Signed-off-by: Zhongtao Hu <[email protected]>
@Tim-0731-Hzt
Copy link
Member Author

/test

@Tim-0731-Hzt
Copy link
Member Author

/test-ubuntu

Tim-0731-Hzt added a commit to Tim-0731-Hzt/tests that referenced this pull request Dec 17, 2022
add hugepage test

Fixes:kata-containers#5242

Depends-on: github.com/kata-containers/kata-containers#5601

Signed-off-by: Zhongtao Hu <[email protected]>
Copy link
Member

@studychao studychao left a comment

Choose a reason for hiding this comment

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

Thanks Tim, some final reviews.

// /dev/hugepages will be the mount point
// mkdir -p /dev/hugepages
// mount -t hugetlbfs none /dev/hugepages
const DEV_HUGEPAGES: &str = "/dev/hugepages";
Copy link
Member

Choose a reason for hiding this comment

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

You assume the mount point could only be /dev/hugepages here. Could this be configurable?

Is this behaviour the same in Go runtime?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@studychao studychao left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM

@studychao studychao merged commit 1511587 into kata-containers:main Dec 25, 2022
dborquez pushed a commit to dborquez/kata-containers that referenced this pull request Jun 5, 2023
This PR adds the http_proxy and https_proxy variables to the docker
build arguments in order to avoid failures when building the images
behind a proxy.

Fixes kata-containers#5601

Signed-off-by: Gabriela Cervantes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
runtime-rs size/large Task of significant size
Projects
None yet
Development

Successfully merging this pull request may close these issues.

runtime-rs: k8s-hugepages.bats failed
6 participants