diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2018-02-02 19:43:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-02 19:43:19 +0000 |
commit | 3ea23f84818a816104ccdcf6b836ac4bb3a7c366 (patch) | |
tree | 7ccc25d859c97ca2cad5282d7e0f4eb9a445c2e3 /vendor/github.com/containerd/cgroups/hugetlb.go | |
parent | a01f708df5d378af6ff4e804464b34f7c9be2b5d (diff) | |
parent | a417e6e0cc46593eb10d2ce3d5102df39d44b8dd (diff) | |
download | podman-3ea23f84818a816104ccdcf6b836ac4bb3a7c366.tar.gz podman-3ea23f84818a816104ccdcf6b836ac4bb3a7c366.tar.bz2 podman-3ea23f84818a816104ccdcf6b836ac4bb3a7c366.zip |
Merge pull request #284 from mheon/update_vendors
Update containerd/cgroups to fix perf issue
Diffstat (limited to 'vendor/github.com/containerd/cgroups/hugetlb.go')
-rw-r--r-- | vendor/github.com/containerd/cgroups/hugetlb.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/vendor/github.com/containerd/cgroups/hugetlb.go b/vendor/github.com/containerd/cgroups/hugetlb.go index 650bb069f..af75e1b8e 100644 --- a/vendor/github.com/containerd/cgroups/hugetlb.go +++ b/vendor/github.com/containerd/cgroups/hugetlb.go @@ -51,20 +51,21 @@ func (h *hugetlbController) Create(path string, resources *specs.LinuxResources) return nil } -func (h *hugetlbController) Stat(path string, stats *Stats) error { - stats.Hugetlb = make(map[string]HugetlbStat) +func (h *hugetlbController) Stat(path string, stats *Metrics) error { for _, size := range h.sizes { s, err := h.readSizeStat(path, size) if err != nil { return err } - stats.Hugetlb[size] = s + stats.Hugetlb = append(stats.Hugetlb, s) } return nil } -func (h *hugetlbController) readSizeStat(path, size string) (HugetlbStat, error) { - var s HugetlbStat +func (h *hugetlbController) readSizeStat(path, size string) (*HugetlbStat, error) { + s := HugetlbStat{ + Pagesize: size, + } for _, t := range []struct { name string value *uint64 @@ -84,9 +85,9 @@ func (h *hugetlbController) readSizeStat(path, size string) (HugetlbStat, error) } { v, err := readUint(filepath.Join(h.Path(path), strings.Join([]string{"hugetlb", size, t.name}, "."))) if err != nil { - return s, err + return nil, err } *t.value = v } - return s, nil + return &s, nil } |