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

From: Minchan Kim
Date: Thu Dec 10 2009 - 20:07:32 EST


On Thu, Dec 10, 2009 at 4:59 PM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxx>
Reviewed-by: Minchan Kim <minchan.kim@xxxxxxxxx>

--
Kind regards,
Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/