Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jul 2002 08:43:38 -0700 (PDT)
From:      Julian Elischer <julian@elischer.org>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        Julian Elischer <julian@FreeBSD.org>, cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org
Subject:   RE: cvs commit: src/sys/sys proc.h src/sys/kern init_main.c kern
Message-ID:  <Pine.BSF.4.21.0207150839260.67349-100000@InterJet.elischer.org>
In-Reply-To: <XFMail.20020715090316.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help


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 <jhb@FreeBSD.org>  <><  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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0207150839260.67349-100000>