diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-02-01 12:55:28 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@gmail.com> | 2018-02-01 12:55:28 -0500 |
commit | ae89dc28d07e1c6142201c282a76d3f237821710 (patch) | |
tree | a729a757fec7c22c5df9f1f65c4cc27556005e7e /vendor/github.com/containerd/cgroups/memory.go | |
parent | 03cfe5ebbee306ee4aa84c74bbff83712e50fb1c (diff) | |
download | podman-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/memory.go')
-rw-r--r-- | vendor/github.com/containerd/cgroups/memory.go | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/vendor/github.com/containerd/cgroups/memory.go b/vendor/github.com/containerd/cgroups/memory.go index 9e2ddf2e4..3ecb0f77f 100644 --- a/vendor/github.com/containerd/cgroups/memory.go +++ b/vendor/github.com/containerd/cgroups/memory.go @@ -81,13 +81,18 @@ func (m *memoryController) Update(path string, resources *specs.LinuxResources) return m.set(path, settings) } -func (m *memoryController) Stat(path string, stats *Stats) error { +func (m *memoryController) Stat(path string, stats *Metrics) error { f, err := os.Open(filepath.Join(m.Path(path), "memory.stat")) if err != nil { return err } defer f.Close() - stats.Memory = &MemoryStat{} + stats.Memory = &MemoryStat{ + Usage: &MemoryEntry{}, + Swap: &MemoryEntry{}, + Kernel: &MemoryEntry{}, + KernelTCP: &MemoryEntry{}, + } if err := m.parseStats(f, stats.Memory); err != nil { return err } @@ -97,19 +102,19 @@ func (m *memoryController) Stat(path string, stats *Stats) error { }{ { module: "", - entry: &stats.Memory.Usage, + entry: stats.Memory.Usage, }, { module: "memsw", - entry: &stats.Memory.Swap, + entry: stats.Memory.Swap, }, { module: "kmem", - entry: &stats.Memory.Kernel, + entry: stats.Memory.Kernel, }, { module: "kmem.tcp", - entry: &stats.Memory.KernelTCP, + entry: stats.Memory.KernelTCP, }, } { for _, tt := range []struct { @@ -155,7 +160,7 @@ func (m *memoryController) OOMEventFD(path string) (uintptr, error) { return 0, err } defer f.Close() - fd, _, serr := unix.RawSyscall(unix.SYS_EVENTFD2, 0, unix.FD_CLOEXEC, 0) + fd, _, serr := unix.RawSyscall(unix.SYS_EVENTFD2, 0, unix.EFD_CLOEXEC, 0) if serr != 0 { return 0, serr } |