linux/Documentation
KAMEZAWA Hiroyuki b084d4353f mm: count swap usage
A frequent questions from users about memory management is what numbers of
swap ents are user for processes.  And this information will give some
hints to oom-killer.

Besides we can count the number of swapents per a process by scanning
/proc/<pid>/smaps, this is very slow and not good for usual process
information handler which works like 'ps' or 'top'.  (ps or top is now
enough slow..)

This patch adds a counter of swapents to mm_counter and update is at each
swap events.  Information is exported via /proc/<pid>/status file as

[kamezawa@bluextal memory]$ cat /proc/self/status
Name:   cat
State:  R (running)
Tgid:   2910
Pid:    2910
PPid:   2823
TracerPid:      0
Uid:    500     500     500     500
Gid:    500     500     500     500
FDSize: 256
Groups: 500
VmPeak:    82696 kB
VmSize:    82696 kB
VmLck:         0 kB
VmHWM:       432 kB
VmRSS:       432 kB
VmData:      172 kB
VmStk:        84 kB
VmExe:        48 kB
VmLib:      1568 kB
VmPTE:        40 kB
VmSwap:        0 kB <=============== this.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Reviewed-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-03-06 11:26:24 -08:00
..
2009-10-01 21:17:49 +02:00
2009-12-03 19:28:53 +01:00
2008-10-16 11:21:30 -07:00
2009-12-16 07:20:05 -08:00
2010-03-06 11:26:24 -08:00
2010-03-02 12:23:49 +01:00
2009-12-09 14:21:36 -08:00
2010-02-28 23:55:20 -08:00
2009-12-12 13:08:16 +01:00
2010-03-01 12:35:43 -03:00
2009-12-22 20:43:40 +01:00
2009-06-18 13:04:04 -07:00
2010-02-26 22:37:29 +01:00
2009-11-09 09:40:54 +01:00
2009-10-04 22:53:41 +02:00
2008-12-03 16:09:53 -07:00
2008-07-25 10:53:30 -07:00
2008-11-14 10:39:26 +11:00
2009-10-15 07:25:20 -06:00
2009-07-01 22:36:22 +02:00
2009-08-28 15:21:12 -04:00
2009-04-27 12:00:27 -07:00
2009-04-27 12:00:27 -07:00
2008-08-12 16:07:30 -07:00
2008-11-12 17:17:17 -08:00
2009-04-14 09:00:23 +10:00