linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: dca@torrent.com
Cc: ak@muc.de, linux-mm@kvack.org
Subject: Re: getrusage
Date: Tue, 3 Aug 1999 16:21:32 +0200	[thread overview]
Message-ID: <19990803162132.A3657@fred.muc.de> (raw)
In-Reply-To: <199908031402.KAA27172@grappelli.torrent.com>; from dca@torrent.com on Tue, Aug 03, 1999 at 04:02:53PM +0200

On Tue, Aug 03, 1999 at 04:02:53PM +0200, dca@torrent.com wrote:
> > How would you count e.g. shared mappings in a single RSS number?
> > I think you need some more fine grained way to report memory use.
> 
> I wrote, then cut out a paragraph from my first mail wondering if
> there was an opportunity to present statistics in a more useful or
> comprehensible way.
> 
> Since the current implementation seems non-functional, there's no
> compatibility to break.  In fact, the trivial "reasonable" change to
> me would seem to be yanking the unset entries from struct rusage.  But
> we should be able to do better than that.
> 
> 
> Here are the relevant entries from struct rusage:
> 
>   long ru_maxrss;     /* maximum resident set size */
>   long ru_ixrss;      /* integral shared memory size */
>   long ru_idrss;      /* integral unshared data size */
>   long ru_isrss;      /* integral unshared stack size */
> 
> 
> I'll presume this covers all interesting types of memory that gets
> mapped into a process's address space.  I'm not sure what the use of
> the integral values are, and they seem more properly the domain of
> vtimes() as on aix and maybe bsd?.  But having access to the current
> raw (unintegrated) values seems more useful to me.  Getting max values
> for each makes sense too.

You need another one: a vm id. Multiple "processes" can share VM 
in linux via clone, and you don't want to account that twice (otherwise
there are funny results like 50MB StarOffice with 10 threads reported as
500MB of memory in gtop). I think it is important to have an unique
identifier to avoid such mistakes.

There is already a patch floating around on l-k that does that,
although it reports via a /proc entry per process. Integrating it in
rusage would be a nice addition. The possible unique ids are memory address
of the kernel mm_struct  (ugly, but zero cost), or the pid of the process
who created the VM first.

> On an implementation note, keeping around max values costs a small bit
> of time whenever a new page is added.  Is this enough to be an issue?

Max limits are useful, and it is usually left in the noise from the
page zeroing anyways.

-Andi

-- 
This is like TV. I don't like TV.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/

  reply	other threads:[~1999-08-03 14:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-03 14:02 getrusage dca
1999-08-03 14:21 ` Andi Kleen [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-08-08 18:02 getrusage dca
1999-08-07  2:00 getrusage grg22
1999-08-02 21:59 getrusage dca
1999-08-03 11:04 ` getrusage Andi Kleen

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=19990803162132.A3657@fred.muc.de \
    --to=ak@muc.de \
    --cc=dca@torrent.com \
    --cc=linux-mm@kvack.org \
    /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