Re: kernel thread as real threads..

From: Kris Kennaway <kris_at_obsecurity.org>
Date: Fri, 20 Jan 2006 04:52:15 -0500
On Fri, Jan 20, 2006 at 02:19:34AM -0700, Scott Long wrote:
> Gleb Smirnoff wrote:
> 
> >On Fri, Jan 20, 2006 at 01:19:55AM -0500, Kris Kennaway wrote:
> >K> > the example I showed was the 'ps' from ddb which of course doesn't 
> >show K> > any stats anyhow.
> >K> 
> >K> Yeah, I know that, but they're also not displayed in ps(1) or top(1),
> >K> etc.
> >
> >And this is a serious issue, that is present in our last releases. If a
> >was a newbie installing FreeBSD for first time, this fact will hurt my
> >impression about operating system most.
> >
> 
> For KSE, threads are just a figment of the imagination of the kernel.  A 
> thread that
> the kernel sees has no specific correlation to a thread that exists in 
> an application.
> Trying to associate stats with these threads is absolultely meaningless. 
>  The
> processing time accumulated for a particular thread that the kernel sees 
> could well
> be the aggregate of a number of user threads, and those user threads are 
> likely migrating
> between the kernel threads.  That's the whole point of M:N threading 
> =-)  Saying that
> thread 1 did X amount of work and thread 2 did Y amount of work simply 
> has no meaning,
> other than that the parent process did X+Y amount of work.

Correct me if I'm wrong, but the stats aren't accounted to the parent
process either.  I'm pretty sure I've seen situations where a thread
was using a lot of CPU, but if you believe top(1) then every process
in the system is idle (except for the fact that the system is 0%
idle).  In this situation there's no way to tell which threaded
process is using resources.

Kris
Received on Fri Jan 20 2006 - 08:52:25 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:51 UTC