Re: system call for process information?

From: Guennadi Liakhovetski (g.liakhovetski@ragingbull.com)
Date: Tue Mar 13 2001 - 04:55:33 EST


Hi Alexander, Nathan and all!

Thanks for your great answers! First of all - I was not REALLY proposing
to include this system call in the kernel - I just wanted to hear some pro
and contra - so, thanks again for your explanations! I started yesterday
sketching the required functions, will have to retreat to reading top & ps
sources, btw, apart from these 2 obvious sources, what else would you
suggest to look through for a good implementation of CPU-utilization
calculator as well as other process (multithreaded, SMP,...) statistics?
Portable (POSIX), maybe some documentation, not just sources?

Thanks
Guennadi

On Mon, 12 Mar 2001, Alexander Viro wrote:

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

___

Dr. Guennadi V. Liakhovetski
Department of Applied Mathematics
University of Sheffield, U.K.
email: G.Liakhovetski@sheffield.ac.uk

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



This archive was generated by hypermail 2b29 : Thu Mar 15 2001 - 21:00:15 EST