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

Change HugepageLimit.Limit type to uint64 #275

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libcontainer/cgroups/fs/hugetlb.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (s *HugetlbGroup) Apply(d *data) error {

func (s *HugetlbGroup) Set(path string, cgroup *configs.Cgroup) error {
for _, hugetlb := range cgroup.HugetlbLimit {
if err := writeFile(path, strings.Join([]string{"hugetlb", hugetlb.Pagesize, "limit_in_bytes"}, "."), strconv.Itoa(hugetlb.Limit)); err != nil {
if err := writeFile(path, strings.Join([]string{"hugetlb", hugetlb.Pagesize, "limit_in_bytes"}, "."), strconv.FormatUint(hugetlb.Limit, 10)); err != nil {
return err
}
}
Expand Down
2 changes: 1 addition & 1 deletion libcontainer/cgroups/fs/hugetlb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestHugetlbSetHugetlb(t *testing.T) {
)

helper.writeFileContents(map[string]string{
limit: strconv.Itoa(hugetlbBefore),
limit: strconv.FormatUint(hugetlbBefore, 10),
})

helper.CgroupData.c.HugetlbLimit = []*configs.HugepageLimit{
Expand Down
2 changes: 1 addition & 1 deletion libcontainer/configs/hugepage_limit.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ type HugepageLimit struct {
Pagesize string `json:"page_size"`

// usage limit for hugepage.
Limit int `json:"limit"`
Limit uint64 `json:"limit"`
}