Re: Generalize /proc/fs/kernel/max-thread

Jean-Michel VANSTEENE (Jean-Michel.Vansteene@bull.net)
Mon, 21 Dec 1998 17:03:32 +0100


Jamie Lokier wrote:
>
> On Mon, Dec 21, 1998 at 01:33:40PM +0100, Jean-Michel VANSTEENE wrote:
> > The value returned is the current max number of tasks, let say,
> > NR_TASKS (or DEFAULT_MAX_THREADS in his patch).
> > I think it is a good idea and could be generalized to standard
> > kernel.
> >
> > So procps utilities could open this "file" to read the current
> > NR_TASK and malloc the internal table with to the right size.
>
> (a) The number of active tasks is the number of links to the /proc
> directory, minus some small constant.

Yes, I said the maximum number of tasks. Maybe you know that the "top"
command, for instance, pre-allocates its internal table so as to collect
process informations. The table size is found in tasks.h (NR_TASKS) at
compile time. If you modify NR_TASKS and compile a new kernel, you must
recompile the "top" command. I know you do that once, but if you have
many different systems, it's not as easy as it could be.

You know, my proposal is an improvement.

> (b) NR_TASK is going to be much larger than the actual number of
> tasks, so it would be silly to preallocate. Consider if NR_TASK were

Look the top command. It preallocates.

> (c) I'd expect approximately 0% performance improvement due to getting

It is not a performance improvement. It is a system administrator's
point of vue. A top command should be runable on all linux boxes. But
it doesn't since it depends on a machine dependent value.

> Nope. To be honest, I can't see any reason to export NR_TASKS except
> for administrative purposes (setting your preferred limit).

Here we are. Administrative purpose. That's the top command, for
example.

-- 
*--* mailto:Jean-Michel.Vansteene@bull.net  (Bull)
*--* mailto:vanstee@worldnet.fr             (Home)
*--* http://www.worldnet.fr/~vanstee        (Jean GABIN)
-------------------------------------------------------------
- - - - - U n   L i n u x   s i n o n   r i e n - - - - - - -

- 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/