From owner-freebsd-arch@FreeBSD.ORG Wed Jun 18 06:33:22 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EFA3D37B401 for ; Wed, 18 Jun 2003 06:33:22 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 47A1943F93 for ; Wed, 18 Jun 2003 06:33:21 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.9/8.12.9) with ESMTP id h5IDXIKJ004580; Wed, 18 Jun 2003 09:33:18 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)h5IDXIXS004577; Wed, 18 Jun 2003 09:33:18 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Wed, 18 Jun 2003 09:33:18 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Poul-Henning Kamp In-Reply-To: <36655.1055917248@critter.freebsd.dk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org Subject: Re: marking normal sleep identifiers as such. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jun 2003 13:33:23 -0000 On Wed, 18 Jun 2003, Poul-Henning Kamp wrote: > Now that we have a bunch of kernel threads which participate in the > running of the system, I find that it is a tad more time consuming to > figure out what the state of a crashed or hung system is. > > So I was wondering if we should instigate a simple convention for the > sleep identifiers to make it easier to spot, or rather: ignore, kthreads > which are in their normal idle position. > > Since thread names are longer than the space we have in ps(1) output > using the thread name is not feasible solution. > > I notice that the interrupt threads all seem to sleep on "-", and all > things considered, I like that. > > Should we adopt that as our convention ? I agree with the concern -- I've similarly noticed an increase in the amount of time I spend diagnosing apparent deadlocks as I attempt to determine if kernel threads are simply idle, or stuck on locks. I don't really mind what the convention is; "-" is probably as good as any. Another possible convention would be to name the state fooidle -- i.e., pageridle, acpiidle, ... Given that the purpose of the thread is documented in the thread name, generally, this is probably overkill and unnecessarilly extends the number and length of strings involved. A final option that comes to mind would be simply to call the state "idle". One disadvantage of changing to a common name with no distinct string is that it makes it quite a bit harder to track down the sleep call in the kernel; you can no longer glimpse/grep on the state to find the stage in the thread event loop you've reached, which would be one reason to prefer a fooidle approach. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories