(a) The number of active tasks is the number of links to the /proc
directory, minus some small constant.
(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
100000.
(c) I'd expect approximately 0% performance improvement due to getting
the right size. But you can get it anyway (see (a)). Resizing tables
is cheap unless the tables are very large, and then it's usually time to
use something else.
(d) the procps utilities time is mostly spent reading files in /proc.
> This will improve procps tools and make them really "exportable".
> Agree?
Nope. To be honest, I can't see any reason to export NR_TASKS except
for administrative purposes (setting your preferred limit).
-- Jamie
-
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/