From owner-freebsd-current@FreeBSD.ORG Fri Jan 20 09:21:00 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2925716A41F; Fri, 20 Jan 2006 09:21:00 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id C9A5F43D55; Fri, 20 Jan 2006 09:20:57 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.14] (imini.samsco.home [192.168.254.14]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id k0K9JZkA088838; Fri, 20 Jan 2006 02:19:35 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <43D0AB26.5070407@samsco.org> Date: Fri, 20 Jan 2006 02:19:34 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.7) Gecko/20050416 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Gleb Smirnoff References: <43D05151.5070409@elischer.org> <20060120030105.GA5286@xor.obsecurity.org> <43D0715A.7020302@elischer.org> <20060120061955.GA8687@xor.obsecurity.org> <20060120085226.GQ83922@FreeBSD.org> In-Reply-To: <20060120085226.GQ83922@FreeBSD.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on pooker.samsco.org Cc: current@freebsd.org, Julian Elischer , Kris Kennaway Subject: Re: kernel thread as real threads.. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2006 09:21:00 -0000 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. For 1:1 threading is does make a little more sense. We'd have to come up with a way to accurately express whether the thread accounting stats are meaningful or not depending on which library is in use. Adding to the complexity would be that KSE can create system and process scope threads, and that system scope threads behave mostly like 1:1 threads. If someone wants to tackle all of this, that would be great, but my only request would be that it can't sacrifice clarity in one library over another library. Scott