Subject: Re: yamt-idlelwp fallout for mips/cobalt?
To: None <,>
From: Michael L. Hitch <>
List: port-cobalt
Date: 06/14/2007 14:56:36
On Thu, 14 Jun 2007, Andrew Doran wrote:

> I'm not yet sure what we need to set into SR in this case, but post
> yamt-idlelwp, LWPs should start up at IPL_SCHED as far as MD code is
> concerned. cpu_switchto() is expected to maintain the IPL at IPL_SCHED or
> above across the switch. If I read the code correctly, PSL_LOWIPL enables
> all interrupts.

   Ah - I just looked at the alpha changes, and the code to set the IPL
level for the new lwp was removed, leaving it what was copied from the
parent.  I thought I had found something simllar in the i386 code, but
I can't find what I remember.

> The call into lwp_startup() does an spl0(). Before it does that, it also
> unlocks the previous LWP if any. If we enable interrupts before unlocking
> the previous LWP, we can end up taking an interrupt and trying to acquire
> a spinlock that is already held.

   In that case, I think not changing the interrupt masking when forking a 
new lwp is probably what is now desired.  The new process will inherit the
IPL level from the parent process (although I'm now sure what it actually
is for the various ports).

Michael L. Hitch
Computer Consultant
Information Technology Center
Montana State University	Bozeman, MT	USA