From owner-cvs-all Mon Jul 15 9: 0:38 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E568337B40C; Mon, 15 Jul 2002 09:00:23 -0700 (PDT) Received: from rwcrmhc51.attbi.com (rwcrmhc51.attbi.com [204.127.198.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8416F43E5E; Mon, 15 Jul 2002 09:00:23 -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 <20020715160023.KBWS24728.rwcrmhc51.attbi.com@InterJet.elischer.org>; Mon, 15 Jul 2002 16:00:23 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id IAA67430; Mon, 15 Jul 2002 08:43:40 -0700 (PDT) Date: Mon, 15 Jul 2002 08:43:38 -0700 (PDT) From: Julian Elischer To: John Baldwin Cc: Julian Elischer , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: RE: cvs commit: src/sys/sys proc.h src/sys/kern init_main.c kern In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 15 Jul 2002, John Baldwin wrote: > > On 14-Jul-2002 Julian Elischer wrote: > > julian 2002/07/13 20:43:33 PDT > > > > Modified files: > > sys/sys proc.h > > sys/kern init_main.c kern_fork.c kern_idle.c > > kern_proc.c kern_switch.c kern_synch.c > > kern_thread.c > > Log: > > Thinking about it I came to the conclusion that the KSE states were incorrectly > > formulated. The correct states should be: > > IDLE: On the idle KSE list for that KSEG > > RUNQ: Linked onto the system run queue. > > THREAD: Attached to a thread and slaved to whatever state the thread is in. > > > > This means that most places where we were adjusting kse state can go away > > as it is just moving around because the thread is.. > > The only places we need to adjust the KSE state is in transition to and from > > the idle and run queues. > > > > Reviewed by: jhb@freebsd.org > > Actually, I think you might be able to go with juse KES_IDLE and KES_THREAD > and use TDS_RUNQ on the thread instead of KES_RUNQ since a KSE should always > have a runnable thread attached to it (i.e. a thread in TDS_RUNQ) when it is > on a runqueue. I thought about this, but I want the KSE state to accuratly reflect when the KSE is linked onto a run queue or an idle queue. The test "if (ke->ke_thread && ke->ke_thread->td_state == TDS_RUNQ)" just seems a littel clumsy to me and the code in runq_add doesn't know at all about threads, just about KSEs. Setting and clearing that state only occurs in that one file so it's not a great inconvenience to keep the state consistant with reality. > > -- > > 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 cvs-all" in the body of the message