linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Roger Luethi <rl@hellgate.ch>
To: Albert Cahalan <albert@users.sf.net>
Cc: linux-kernel mailing list <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org, wli@holomorphy.com
Subject: Re: [proc.txt] Fix /proc/pid/statm documentation
Date: Fri, 6 Aug 2004 20:21:31 +0200	[thread overview]
Message-ID: <20040806182131.GA2611@k3.hellgate.ch> (raw)
In-Reply-To: <1091803883.1231.2502.camel@cube>

On Fri, 06 Aug 2004 10:51:24 -0400, Albert Cahalan wrote:
> Everybody else can parse ps output.

Not everybody wants to. And ps doesn't provide all the process
information I can get via proc anyway.

> > Some users may prefer written documentation over reading the kernel
> > source. In addition, in the case of statm, there is nothing to document
> > the expected behavior in the source, either. Which is precisely why
> > statm has been utterly broken forever.
> 
> A correct proc.txt would not have avoided this.

It would have helped some of us confirming our suspicions.

> The source code needs a few comments.

Works for me. I'm looking forward to see that fixed.

> > It was not dumb. Some people actually prefer human-readable output when
> > working with proc.
> 
> These people shouldn't be working in /proc. It's easier and

Let me be the one to decide when I use a proc file.

> more portable to use "ps" for their scripts. You can select
> which fields you want, get a header if you like, have the
> processes filtered for you, and so on. Look:
> 
> ps -U root -u root -o pid= -o ppid= -o args
> 
> What's not to like about that? It's portable even.

I wouldn't like ps to be the gatekeeper to proc information. Plus
there's non-portable information in proc that I care about.

> > > On AIX:  ps -eo trs
> > > On BSD:  ps axo trss
> > 
> > I trust they take that information from /proc/pid/statm, too?
> 
> The point is that the name "trs" has a specific meaning.
> The statm file was created to support ps. It wouldn't exist
> if ps didn't need to display a TRS column. So the proper
> behavior of ps is what defines the meaning. Run these two

Fair enough. I think proc.txt should note this relation between
statm and ps.

> > > >> + dt       number of dirty pages   (always 0 on 2.6)
> > > >>
> > > >> This one would be useful.
> > > >
> > > > Agreed. It would be nice to have it somewhere else.
> > > 
> > > No, it's not nice to go moving things around. How about you go
> > 
> > This field is 0 on 2.6. Zero. Always. I am suggesting to have the
> > information available somewhere. That sure ought to count as an
> > improvement.
> 
> Sure. That "somewhere" should be where it was before.

I wouldn't mind seeing it in /proc/pid/status if the accounting gets
merged.

> > > > Hey, I am all _for_ improving proc. But rather than adding more values,
> > > > I'd like to address some design problems first: For example, I'd
> > > > like to have a reserved value for N/A (currently, kernels just set
> > > > obsolete fields to 0 and parsers must guess whether it's truly 0 or not
> > > > available).
> > > 
> > > Don't even think of changing this.
> > 
> > Why not? Got a better solution?
> 
> Old tools need a value that will best make them work. (zero)

True for old fields. New fields are a different matter.

> New tools can examine the kernel version number.

Right. And every user space tool reading proc needs a database to
remember which field is active in which kernel version.

> > The current state of statm code clearly demonstrates the level of
> > interest in this concept.
> 
> It demonstrates that misleading data is hard to spot.
> It demonstrates that people hacking on the kernel are
> often unconcerned with providing correct stats for others.

I'd agree to some extent, but statm was pretty much impossible to fix
for even the most concerned kernel hacker.

Roger
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

      parent reply	other threads:[~2004-08-06 18:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1091754711.1231.2388.camel@cube>
     [not found] ` <20040806094037.GB11358@k3.hellgate.ch>
     [not found]   ` <20040806104630.GA17188@holomorphy.com>
2004-08-06 12:01     ` Roger Luethi
2004-08-06 12:11       ` William Lee Irwin III
2004-08-06 13:57         ` Roger Luethi
2004-08-06 14:07           ` William Lee Irwin III
2004-08-06 15:02             ` Roger Luethi
2004-08-06 14:02       ` Albert Cahalan
2004-08-06 16:48         ` William Lee Irwin III
2004-08-06 17:08         ` Roger Luethi
2004-08-06 15:14           ` Albert Cahalan
2004-08-06 20:49             ` Martin J. Bligh
2004-08-06 18:38               ` Albert Cahalan
2004-08-06 21:15                 ` Martin J. Bligh
2004-08-07 17:37         ` Paul Jackson
2004-08-06 12:58   ` Albert Cahalan
2004-08-06 15:48     ` William Lee Irwin III
2004-08-06 14:14       ` Albert Cahalan
2004-08-06 16:49         ` William Lee Irwin III
2004-08-06 16:34     ` Roger Luethi
2004-08-06 14:51       ` Albert Cahalan
2004-08-06 17:28         ` Martin J. Bligh
2004-08-06 18:21         ` Roger Luethi [this message]

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=20040806182131.GA2611@k3.hellgate.ch \
    --to=rl@hellgate.ch \
    --cc=albert@users.sf.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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