aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/net_dropmonitor.py
diff options
context:
space:
mode:
authorMinchan Kim <[email protected]>2015-09-08 15:00:24 -0700
committerLinus Torvalds <[email protected]>2015-09-08 15:35:28 -0700
commit8334b96221ff0dcbde4873d31eb4d84774ed8ed4 (patch)
tree35c6f7a7ab427834a10c3e74ccedcac9911e588a /tools/perf/scripts/python/net_dropmonitor.py
parent3115aec4513e5bcb399235cac98a5637fe641c13 (diff)
mm: /proc/pid/smaps:: show proportional swap share of the mapping
We want to know per-process workingset size for smart memory management on userland and we use swap(ex, zram) heavily to maximize memory efficiency so workingset includes swap as well as RSS. On such system, if there are lots of shared anonymous pages, it's really hard to figure out exactly how many each process consumes memory(ie, rss + wap) if the system has lots of shared anonymous memory(e.g, android). This patch introduces SwapPss field on /proc/<pid>/smaps so we can get more exact workingset size per process. Bongkyu tested it. Result is below. 1. 50M used swap SwapTotal: 461976 kB SwapFree: 411192 kB $ adb shell cat /proc/*/smaps | grep "SwapPss:" | awk '{sum += $2} END {print sum}'; 48236 $ adb shell cat /proc/*/smaps | grep "Swap:" | awk '{sum += $2} END {print sum}'; 141184 2. 240M used swap SwapTotal: 461976 kB SwapFree: 216808 kB $ adb shell cat /proc/*/smaps | grep "SwapPss:" | awk '{sum += $2} END {print sum}'; 230315 $ adb shell cat /proc/*/smaps | grep "Swap:" | awk '{sum += $2} END {print sum}'; 1387744 [[email protected]: simplify kunmap_atomic() call] Signed-off-by: Minchan Kim <[email protected]> Reported-by: Bongkyu Kim <[email protected]> Tested-by: Bongkyu Kim <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Sergey Senozhatsky <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Jerome Marchand <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/net_dropmonitor.py')
0 files changed, 0 insertions, 0 deletions