Re: system call for process information?

Alexander Viro (viro@math.psu.edu)
Mon, 12 Mar 2001 22:20:46 -0500 (EST)


On Mon, 12 Mar 2001, Nathan Paul Simons wrote:

> On Mon, Mar 12, 2001 at 09:21:37PM +0000, Guennadi Liakhovetski wrote:
> > CPU utilisation. Each new application has to calculate it (ps, top, qps,
> > kps, various sysmons, procmons, etc.). Wouldn't it be worth it having a
> > syscall for that? Wouldn't it be more optimal?

The first rule of optimization: don't. I.e. optimizing something that
is not a bottleneck is pointless.

> No, it wouldn't be worth it because you're talking about
> sacrificing simplicity and kernel speed in favor of functionality.

Or, in that case, in favour of nothing. It doesn't add any functionality.

> This has been know to lead to "bloat-ware". Every new syscall you
> add takes just a little bit more time and space in the kernel, and
> when only a small number of programs will be using it, it's really
> not worth it. This time and space may not be large, but once you
> get _your_ syscall added, why can't everyone else get theirs added
> as well? And so, after making about a thousand specialized syscalls
> standard in the kernel, you end up with IRIX (from what I've heard).

In that case there is much simpler argument.

If your program checks the system load so often that converting results
from ASCII to integers takes noticable time - all you are measuring
is the load created by that program. In other words, any program that
would get any speedup from such syscall is absolutely worthless, since
the load created by measurement will drown the load you are trying
to measure.

End of story. It's not only unnecessary and tasteless, it's
useless.
Cheers,
Al

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