Skip to content

Commit

Permalink
Merge pull request #3001 from bobrik/ivan/fix-swap-accounting-v2
Browse files Browse the repository at this point in the history
cgroupv2: fix swap accounting
  • Loading branch information
bobbypage authored Nov 9, 2021
2 parents 79b4c64 + ef98eb4 commit 3c6e309
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion container/libcontainer/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ func setMemoryStats(s *cgroups.Stats, ret *info.ContainerStats) {
if cgroups.IsCgroup2UnifiedMode() {
ret.Memory.Cache = s.MemoryStats.Stats["file"]
ret.Memory.RSS = s.MemoryStats.Stats["anon"]
ret.Memory.Swap = s.MemoryStats.SwapUsage.Usage
ret.Memory.Swap = s.MemoryStats.SwapUsage.Usage - s.MemoryStats.Usage.Usage
ret.Memory.MappedFile = s.MemoryStats.Stats["file_mapped"]
} else if s.MemoryStats.UseHierarchy {
ret.Memory.Cache = s.MemoryStats.Stats["total_cache"]
Expand Down

0 comments on commit 3c6e309

Please sign in to comment.