Loadable Scheduler in Freebsd

Julian Elischer julian at elischer.org
Sat Nov 6 18:58:57 PST 2004


John-Mark Gurney wrote:
> Devesh Shah wrote this message on Thu, Nov 04, 2004 at 15:22 -0800:
> 
>>Based on the SYSINIT framework, I have made ULE scheduler as a loadable module but have not quite
>>figured how to migrate from default 4bsd to newly loaded ule scheduler or is it possible at all.
> 
> 
> As someone suggested, switches schedulers would be very complex..
> 
> what would be much more doable is require a scheduler module loaded by
> loader, and then select which scheduler from the loader...  (though I
> don't know how many ifdef's outside scheduler modules exist today)..

ONE

in kern_kse.c:
                 td->td_pflags &= ~TDP_CAN_UNBIND;
                 td2 = thread_schedule_upcall(td, ku);
#ifdef SCHED_4BSD
                 if (flags & SW_INVOL || nextthread) {
                         setrunqueue(td2, SRQ_YIELDING);
                 } else {
                         /* Keep up with reality.. we have one extra thread
                          * in the picture.. and it's 'running'.
                          */
                         return td2;
                 }
#else
                 setrunqueue(td2, SRQ_YIELDING);
#endif


it would be safe to always use the Non-4bsd path
> 



More information about the freebsd-hackers mailing list