diff options
author | Vladimir Davydov <[email protected]> | 2016-08-11 15:33:00 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2016-08-11 16:58:13 -0700 |
commit | 1f47b61fb4077936465dcde872a4e5cc4fe708da (patch) | |
tree | cc16f86163ea1f672d4264ad9168a01359315437 /tools/perf/scripts/python/bin/export-to-postgresql-report | |
parent | 2f95ff90b99600f53df4a0aa652322d349d67957 (diff) |
mm: memcontrol: fix swap counter leak on swapout from offline cgroup
An offline memory cgroup might have anonymous memory or shmem left
charged to it and no swap. Since only swap entries pin the id of an
offline cgroup, such a cgroup will have no id and so an attempt to
swapout its anon/shmem will not store memory cgroup info in the swap
cgroup map. As a result, memcg->swap or memcg->memsw will never get
uncharged from it and any of its ascendants.
Fix this by always charging swapout to the first ancestor cgroup that
hasn't released its id yet.
[[email protected]: add comment to mem_cgroup_swapout]
[[email protected]: use WARN_ON_ONCE() in mem_cgroup_id_get_online()]
Link: http://lkml.kernel.org/r/20160803123445.GJ13263@esperanza
Fixes: 73f576c04b941 ("mm: memcontrol: fix cgroup creation failure after many small jobs")
Link: http://lkml.kernel.org/r/5336daa5c9a32e776067773d9da655d2dc126491.1470219853.git.vdavydov@virtuozzo.com
Signed-off-by: Vladimir Davydov <[email protected]>
Acked-by: Johannes Weiner <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: <[email protected]> [3.19+]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/bin/export-to-postgresql-report')
0 files changed, 0 insertions, 0 deletions