summaryrefslogtreecommitdiff
path: root/vendor/github.com/containerd/cgroups/memory.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-02-02 19:43:19 +0000
committerGitHub <noreply@github.com>2018-02-02 19:43:19 +0000
commit3ea23f84818a816104ccdcf6b836ac4bb3a7c366 (patch)
tree7ccc25d859c97ca2cad5282d7e0f4eb9a445c2e3 /vendor/github.com/containerd/cgroups/memory.go
parenta01f708df5d378af6ff4e804464b34f7c9be2b5d (diff)
parenta417e6e0cc46593eb10d2ce3d5102df39d44b8dd (diff)
downloadpodman-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/memory.go')
-rw-r--r--vendor/github.com/containerd/cgroups/memory.go19
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
}