Re: [PATCH] add "VmUsers: N" to /proc/$PID/status

From: Valdis . Kletnieks
Date: Thu Jul 16 2009 - 15:46:47 EST


On Wed, 15 Jul 2009 03:22:18 +0200, Denys Vlasenko said:

> It can be nice to know how many such CLONE_VM'ed processes
> share VM with given /proc/PID. Then it would be possible to do
> more accurate accounting of memory usage. Say, by dividing
> all memory usage numbers of this process by this number.

Process A clones a process A1. Process B clones a process B1. Now
all 4 of them have 'VmUsers: 2' on them, but there's no clean way to tell
whether A1 or B1 is the one sharing with A, or with B.

The patch is probably sufficient if all you want is some N to divide by, but
not if you care *which* processes are sharing how much.

Attachment: pgp00000.pgp
Description: PGP signature