Re: [RFC] fast atomic ps

From: Borislav Deianov (borislav@lix.polytechnique.fr)
Date: Thu Apr 06 2000 - 10:08:22 EST


On Wed, Apr 05, 2000 at 10:46:05PM -0400, Albert D. Cahalan wrote:
> For full-blown ps on a busy system this could be over 4 GB.
> (32 k processes * 128 k args + other stuff) Not that this works
> today though, but please note that the data can be quite large.
>
> So maybe you skip command lines...

I'm thinking of a fixed-sized struct per process and leaving 128k of
space in each is not an option... I guess I can put something like 64
bytes for command lines, better than nothing. Environment has that
problem too, maybe skip that entirely, just the start is not very
useful there.

> I suggest that _everything_ be 64-bit for easy alignment and
> expansion, especially considering ia64 with 32-bit apps.

Expansion can be done like this: the very first thing in the output is
an int that tells you how big the struct is. New fields are always
added at the end and old ps/top can just skip fields it doesn't know
about.

I'm a bit reluctant to make everything 64-bit since that essentially
doubles the size of the output on 32-bit archs. On the other hand
there aren't many other choices if 32-bit support on 64-bit archs is
needed. I suppose I can leave the int fields at 32-bit since int is 32
bits on all current 64-bit archs, but that doesn't help too much -
most of the fields are longs.

So which is more important - 32-bit support on 64-bit or the size of
the output on 32-bit native?

> You might grab the minimal.c source from procps. It currently does

OK, thanks.

Regards,
Borislav

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Apr 07 2000 - 21:00:16 EST