Alu Powerbook

John Baldwin jhb at FreeBSD.org
Tue Feb 10 10:04:58 PST 2004


On Monday 09 February 2004 08:18 pm, Peter Grehan wrote:
> Hi John,
>
>   A few questions:
> >>  The second argument of ithread_schedule determines if the current
> >>thread can be pre-empted. The sparc64 and ia64 ports both leave this
> >>as zero, and ppc followed suit to be conservative.
> >
> > Actually, it should be turned on for each arch that can handle it. 
> > However, it should be !cold as in i386 case as it isn't safe to switch
> > yet when cold is set.  Alpha doesn't have it on as the last time I tried
> > it on SMP it caused hangs under load.  I do not know why other archs have
> > it disabled.
>
>   Are there any gotchas as to what defines "can handle it" ?

Doesn't lockup or panic under load. :)

>   With the '!cold' case on 386/amd64, is that because threads running
> up until that point assume that interrupts can't be delivered, or
> shouldn't be pre-empted since they're kernel threads ?

cold is only true before the scheduler is ready to run ithreads during early 
boot.  The current thread is always thread0.  Currently cold is set for the 
new-bus boot probe and cleared afterwards.  Preemption should be avoided 
because it's not safe to switch yet.

>   And lastly, whereabouts in interrupt processing would the
> oft-talked-about 'context stealing' occurr ? Is it ithread-schedule,
> or in MD code before that gets called ?

It would have to be in MD code.  The MD code may end up re-implementing 
ithread_schedule() and using a modified version of ithread_loop().  However, 
just getting it working using a regular context switch is a good first step.

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



More information about the freebsd-ppc mailing list