cvs commit: src/sys/kern sched_ule.c

Jeff Roberson jroberson at chesapeake.net
Tue Oct 2 14:31:33 PDT 2007


On Tue, 2 Oct 2007, Peter Grehan wrote:

> Hi Jeff,
>
>> If you can test ULE on UP arm/powerpc I'd appreciate it.
>
> Works fine on ppc after some minor tweaks. I've attached the diff for those 
> interested. A couple of questions:
>
> - Can ULE work without preemption ? When it wasn't enabled, the system 
> wouldn't switch out of the idle loop. There's a comment in sched_idletd():

It always must use preemption with idletd.  You can disable it in all 
other cases by omitting the PREEMPTION option...

Ah I see the bug now.  I only tested by adjusting 
kern.sched.preempt_thresh.  I didn't notice that the code in 
critical_exit() is conditional.  I'll fix that so it should work without 
PREEMPTION.

>
>          /* ULE relies on preemption for idle interruption. */
>
>   I'm asking because PREEMPTION has never been switched on in PPC, and it 
> might be nice to enable ULE without having to determine if bugs are in 
> PREEMPTION or ULE.

Once I fix critical_exit() it should only preempt idle which is unlikely 
to cause bugs, except perhaps in your cpu_idle implementation.

>
> - ppc's cpu_throw() was implemented in C. I modified it to pass the 
> thread-lock mutex from the old thread, so the context switch routine would 
> simply write it back. Is that an OK thing to do ?

Yes, that's fine.

Thanks!
Jeff

>
> later,
>
> Peter.
>


More information about the freebsd-ppc mailing list