public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Albert Cahalan <albert@users.sf.net>
To: Andrea Arcangeli <andrea@novell.com>
Cc: Hugh Dickins <hugh@veritas.com>,
	linux-kernel mailing list <linux-kernel@vger.kernel.org>,
	Andrew Morton OSDL <akpm@osdl.org>,
	William Lee Irwin III <wli@holomorphy.com>,
	Albert Cahalan <albert@users.sourceforge.net>
Subject: Re: per-process shared information
Date: 15 Oct 2004 13:51:56 -0400	[thread overview]
Message-ID: <1097862714.2666.13650.camel@cube> (raw)
In-Reply-To: <20041015171355.GD17849@dualathlon.random>

On Fri, 2004-10-15 at 13:13, Andrea Arcangeli wrote:
> On Fri, Oct 15, 2004 at 12:31:52PM -0400, Albert Cahalan wrote:
> > Currently, ps uses /proc/*/stat for that. The /proc/*/statm
> 
> maybe you mean /proc/pid/status, status has the RSS and most virtual
> info too, I doubt stat has it too (a trivial grep doesn't reveal it at
> least).

It's a popular value.

stat: in bytes, between vsize and rss_rlim
statm: in pages, between size and share
status:  in KiB as VmRSS

> Anyways my ps definitely reads /proc/*/statm with the 'v' option
> (confirmed by strace).

Sure. That's not because of RSS. It's for TRS and DRS,
which are supposed to be RSS-like values specific to
text (code) and data.

The VM size of text is TSIZ, and of data is DSIZ.
These numbers, while useful, are not the same thing.

> peraphs we use different procps version. I heard there is more than one
> version, and I know you're maintaining one but I never followed the
> details, you sure know better than me why the above is happening on my
> machine. But the point is that there are widely used apps opening statm
> (top as you mentioned), and those apps normally don't care about
> "shared" (or at least they can't underflow), and those must run on the
> big boxes too, and statm was basically unfixable.

A user can configure top to display other columns if
he has a box that can't handle /proc/*/statm well.
The file will not be read if it is not needed.
Start top, then do:

f     enters field modification screen
o     disable VIRT
q     disable RES
t     disable SHR
n     disable %MEM
enter exits field modification screen
W     writes a ~/.toprc file

So, what is the problem again?  :-)

> > What exactly would be the difference, and when might users see it?
> 
> one difference for example is that it cannot take into account for
> shared anonymous pages generated by fork(). Or other corner cases would
> be posisble, but I believe it's a minor issue... so it's looking good.
> Frankly I was thinking shared as a page_mapcount > 1, while all
> pagecache is considered "shared", so Hugh's algorithm is a lot closer to
> the old shared than what I thought originally. Peraphs solaris also
> implements it as rss - anon_rss (I mean, they must be facing similar
> issues, and the report states the "shared" info is being reported with
> the same semantics on linux 2.4 and solaris and some other unix... so
> the theory Hugh's matching other unix even better than 2.4 sounds
> reasonable).

Well, as long as it makes the users happy... I don't personally
care, except to say that I don't care to document all sorts
of kernel-specific variations. It gets hopelessly messy.



  reply	other threads:[~2004-10-15 17:59 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-13 23:10 per-process shared information Andrea Arcangeli
2004-10-14 21:47 ` Marcelo Tosatti
2004-10-14 23:58   ` Andrea Arcangeli
2004-10-14 23:17     ` Marcelo Tosatti
2004-10-15 10:45     ` William Lee Irwin III
2004-10-14 21:49 ` Hugh Dickins
2004-10-14 22:11   ` William Lee Irwin III
2004-10-14 22:37   ` Andrea Arcangeli
2004-10-15 10:51     ` William Lee Irwin III
2004-10-15 11:56     ` Hugh Dickins
2004-10-15 13:19       ` Albert Cahalan
2004-10-15 14:28         ` William Lee Irwin III
2004-10-15 14:40           ` Albert Cahalan
2004-10-15 14:52             ` William Lee Irwin III
2004-10-15 17:02             ` Andrea Arcangeli
2004-10-15 16:20         ` Andrea Arcangeli
2004-10-15 16:31           ` Albert Cahalan
2004-10-15 17:10             ` William Lee Irwin III
2004-10-15 19:29               ` Albert Cahalan
2004-10-15 17:13             ` Andrea Arcangeli
2004-10-15 17:51               ` Albert Cahalan [this message]
2004-10-15 18:14                 ` Andrea Arcangeli
2004-10-15 18:30                   ` William Lee Irwin III
2004-10-15 18:40                     ` Andrea Arcangeli
2004-10-15 18:47                       ` William Lee Irwin III
2004-10-15 19:23                         ` Andrea Arcangeli
2004-10-15 20:41                           ` William Lee Irwin III
2004-10-15 20:52                             ` Andrea Arcangeli
2004-10-15 21:16                         ` William Lee Irwin III
2004-10-15 21:28                           ` Andrea Arcangeli
2004-10-15 21:40                             ` William Lee Irwin III
2004-10-15 22:04                               ` Hugh Dickins
2004-10-19 15:09           ` Bill Davidsen
2004-10-15 16:04       ` Andrea Arcangeli
2004-10-19 15:18         ` Bill Davidsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1097862714.2666.13650.camel@cube \
    --to=albert@users.sf.net \
    --cc=akpm@osdl.org \
    --cc=albert@users.sourceforge.net \
    --cc=andrea@novell.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wli@holomorphy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox