From: Albert Cahalan <albert@users.sf.net>
To: wli@holomorphy.com
Cc: linux-kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: fix text reporting in O(1) proc_pid_statm()
Date: 24 Aug 2004 19:06:56 -0400 [thread overview]
Message-ID: <1093388816.434.355.camel@cube> (raw)
> - *text = mm->exec_vm - ((mm->end_code - mm->start_code) >> PAGE_SHIFT);
> - *data = mm->total_vm - mm->shared_vm;
> + *text = (mm->end_code - mm->start_code) >> PAGE_SHIFT;
> + *data = mm->total_vm - mm->shared_vm - *text;
It's actually still wrong. This has been broken for
a very long time. It you can fix it, great. Otherwise
this is a useless value, since /proc/*/stat provides
start_code and end_code already.
The statm file is supposed to contain a field known
as "trs" or "trss". This is like rss, but text-only.
Likewise, statm also contains "drs" or "drss" for data.
When you subtract start_code from end_code, you're
generating a value known as "tsiz" (the text size).
The statm file is supposed to supply trs, not tsiz.
Back in the days of a.out, statm also contained lrs
for libraries. ELF broke this.
The statm VM size is supposed to count IO mappings.
So if your X server maps 64 MB of video RAM, then
the statm file should have a value 64 MB larger than
the status file has.
next reply other threads:[~2004-08-24 23:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-24 23:06 Albert Cahalan [this message]
2004-08-24 23:12 ` fix text reporting in O(1) proc_pid_statm() William Lee Irwin III
2004-08-24 23:18 ` William Lee Irwin III
2004-08-24 23:24 ` William Lee Irwin III
2004-08-25 0:01 ` William Lee Irwin III
2004-08-25 2:52 ` Albert Cahalan
2004-08-25 3:04 ` William Lee Irwin III
-- strict thread matches above, loose matches on Subject: below --
2004-08-22 8:34 2.6.8.1-mm4 Andrew Morton
2004-08-23 20:21 ` 2.6.8.1-mm4 wli
2004-08-24 6:14 ` 2.6.8.1-mm4 Andrew Morton
2004-08-24 7:55 ` O(1) proc_pid_statm() William Lee Irwin III
2004-08-24 17:05 ` fix text reporting in " William Lee Irwin III
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=1093388816.434.355.camel@cube \
--to=albert@users.sf.net \
--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