From owner-freebsd-arch Tue Sep 3 13:20:19 2002 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 82B4737B400; Tue, 3 Sep 2002 13:20:10 -0700 (PDT) Received: from rwcrmhc51.attbi.com (rwcrmhc51.attbi.com [204.127.198.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id B0E5043E84; Tue, 3 Sep 2002 13:20:08 -0700 (PDT) (envelope-from julian@elischer.org) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc51.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020903202008.MGSV12451.rwcrmhc51.attbi.com@InterJet.elischer.org>; Tue, 3 Sep 2002 20:20:08 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id NAA14635; Tue, 3 Sep 2002 13:07:41 -0700 (PDT) Date: Tue, 3 Sep 2002 13:07:39 -0700 (PDT) From: Julian Elischer To: John Baldwin Cc: arch@freebsd.org, Alfred Perlstein Subject: Re: Process/thread states. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 3 Sep 2002, John Baldwin wrote: > > On 03-Sep-2002 Julian Elischer wrote: > > We'd (david and I) like to go ahead and provide a general patch to > > implement this, for others to peruse, but we'd like to > > hear if there will be screaming first before we do more work on it.. > > Please be consistent. You have SLEEPING, so I would use SLEEP instead > of SLP. Also, I would use CLEAR instead of CLR. Personally I don't > want to have to use Caps Lock to write kernel code and I find the > kernel shouting at me about thread states to be a bit much (I don't > see why just using == to check a thread state is all that hard). because it in some cases actually becomes: (due to the fact thst you can be on the sleep queue AND teh run queue) #define TD_ON_RUNQ(td) (((td)->td_state & TD_BASE_MASK) == TD_ST_RUNQ) as you have to separate out the sleep queue bit. Ther eis a possibility that these states may get worse when thread suspensions and swapping are added to the picture. A thread can be swapped (as part of the process), AND sleeping AND suspended. Do you really want to type that sort of test everywhere? By making it a macro we can keep the implementation of this state hidden. e.g if we move the RUNQ part of the state to td_flags to make it independently testable, the rest of the code doesn;t have to know how we optimised this. (we are discussing this exact change now). similarly for swapped.. or other states. > Just please at least be consistent if you are going to uglify things. I prefer TD_ON_RUNQ(td) to (((td)->td_state & TD_BASESTATE_MASK) == TD_ST_RUNQ) > > -- > > John Baldwin <>< http://www.FreeBSD.org/~jhb/ > "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-arch" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message