Re: per-process shared information

Albert Cahalan
2004-10-15T16:41:40Z

On Fri, 2004-10-15 at 12:20, Andrea Arcangeli wrote:

> the problem is that when ps xav wants to know the RSS it reads statm,
> so we just cannot hurt ps xav to show the "old shared" information that
> would be extremely slow to collect.

Currently, ps uses /proc/*/stat for that. The /proc/*/statm
file is read to determine TRS and DRS, which are broken now.
That it, unless you count "ps -o OL_m" format.

The top program uses /proc/*/statm for many more fields:

%MEM Memory usage (RES)
VIRT Virtual Image (kb)
SWAP Swapped size (kb)
RES Resident size (kb)
CODE Code size (kb)
DATA Data+Stack size (kb)
SHR Shared Mem size (kb)
nDRT Dirty Pages count

> I was only not happy about dropping the old feature completely instead
> of providing it with a different new API. Now I think the solution Hugh
> just proposed with the anon_rss should mimic the old behaviour well
> enough and it's probably the right way to go, it's still not literally
> the same, but I doubt most people from userspace could notice the
> difference, and most important it provides useful information, which is
> the number of _physical_ pages mapped that aren't anonymous memory, this
> is very valuable info and it's basically the same info that people was
> getting from the old "shared". So I like it.

What exactly would be the difference, and when might users see it?