All of lore.kernel.org
 help / color / mirror / Atom feed
From: Werner Almesberger <wa@almesberger.net>
To: "Albert D. Cahalan" <acahalan@cs.uml.edu>
Cc: linux-kernel@vger.kernel.org, mbligh@aracnet.com, jw@pegasys.ws,
	rml@tech9.net, andersen@codepoet.org, woofwoof@hathway.com
Subject: Re: ps performance sucks
Date: Tue, 5 Nov 2002 22:29:40 -0300	[thread overview]
Message-ID: <20021105222940.C10679@almesberger.net> (raw)
In-Reply-To: <200211060010.gA60ALY387457@saturn.cs.uml.edu>; from acahalan@cs.uml.edu on Tue, Nov 05, 2002 at 07:10:20PM -0500

Albert D. Cahalan wrote:
> I was thinking "80basic" would ask for the first 0x80 words
> of basic info. If there's less, zero-fill. If there's more,
> truncate the struct. Then "20pids" asks for the first 0x20
> words of pid info (pid, ppid, sess, pgid...) and so on.

Argl, this has "silent failure" written all over it. No, I think
single-field granularity wouldn't incur excessive overhead: at
run time, you can trivially handle adjacent fields with a single
copy, and I don't think there are really that many practically
useful fields that setup cost (CPU or memory) would be terrible.

[ Various change horrors ]

Hmm yes, about as bad as I remember it from my psmisc days :-(

> That's nice, until you exceed the amount of memory available.

That would the the least of my concerns. If you really run out
of memory, you can always fall back to an iterative process.

> Hey, if reiserfs can have a database query syscall... >:-)
> open("/proc/SELECT PID,TTY,TIME,CMD FROM PS WHERE RUID=42",O_RDONLY)

Cute ;-) But it might be faster just to dump the whole data,
and let user space worry about picking the right entries.

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina         wa@almesberger.net /
/_http://www.almesberger.net/____________________________________________/

  reply	other threads:[~2002-11-06  1:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-05 21:39 ps performance sucks Albert D. Cahalan
2002-11-05 22:46 ` Rik van Riel
2002-11-05 22:48   ` Robert Love
2002-11-05 23:23     ` Miquel van Smoorenburg
2002-11-05 23:37   ` Albert D. Cahalan
2002-11-05 23:37 ` Werner Almesberger
2002-11-06  0:10   ` Albert D. Cahalan
2002-11-06  1:29     ` Werner Almesberger [this message]
2002-11-07 17:19 ` Bill Davidsen
2002-11-07 20:42   ` Albert D. Cahalan
2002-11-07 21:05     ` Andrew Morton
2002-11-07 22:02       ` Albert D. Cahalan
2002-11-07 22:21         ` Andrew Morton
2002-11-08 21:05     ` 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=20021105222940.C10679@almesberger.net \
    --to=wa@almesberger.net \
    --cc=acahalan@cs.uml.edu \
    --cc=andersen@codepoet.org \
    --cc=jw@pegasys.ws \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@aracnet.com \
    --cc=rml@tech9.net \
    --cc=woofwoof@hathway.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.