Re: [RFC mm][PATCH 3/5] counting swap ents per mm

Minchan Kim
2009-12-11T01:07:28Z

On Thu, Dec 10, 2009 at 4:59 PM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu@jp.fujitsu.com> wrote:
>
> One of 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 ~]$ cat /proc/self/status
> Name:   cat
> State:  R (running)
> Tgid:   2904
> Pid:    2904
> PPid:   2862
> 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:       504 kB
> VmRSS:       504 kB
> VmData:      172 kB
> VmStk:        84 kB
> VmExe:        48 kB
> VmLib:      1568 kB
> VmPTE:        40 kB
> VmSwap:        0 kB <============== this.
>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>

--
Kind regards,
Minchan Kim