summaryrefslogtreecommitdiff
path: root/vendor/github.com/containerd/cgroups/hugetlb.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-02-01 12:55:28 -0500
committerMatthew Heon <matthew.heon@gmail.com>2018-02-01 12:55:28 -0500
commitae89dc28d07e1c6142201c282a76d3f237821710 (patch)
treea729a757fec7c22c5df9f1f65c4cc27556005e7e /vendor/github.com/containerd/cgroups/hugetlb.go
parent03cfe5ebbee306ee4aa84c74bbff83712e50fb1c (diff)
downloadpodman-ae89dc28d07e1c6142201c282a76d3f237821710.tar.gz
podman-ae89dc28d07e1c6142201c282a76d3f237821710.tar.bz2
podman-ae89dc28d07e1c6142201c282a76d3f237821710.zip
Update containerd/cgroups repo fix perf issue
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Diffstat (limited to 'vendor/github.com/containerd/cgroups/hugetlb.go')
-rw-r--r--vendor/github.com/containerd/cgroups/hugetlb.go15
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
}