From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: From: Jessica Yu Date: Sat, 21 Jun 2014 18:45:27 -0700 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] [GSOC] plan9 kernel scheduler Topicbox-Message-UUID: fc5aee88-ead8-11e9-9d60-3106f5b1d025 +1 what Yoann said. :-) On SMP systems, all maches share a global run queue, and maches tend to try grabbing procs that have run on it before (affinity). Take a look at port/proc.c in particular, where a lot of the scheduling logic is implemented. On Sat, Jun 21, 2014 at 6:10 PM, Yoann Padioleau wrote: > if you look in sys/src/9/port > and grep for functions like > > sched() > schedinit() > runproc() > updatecpu() > repriotirize() > > you'll get the logic of the scheduling algorithm. It's mostly > priority queue fair robin I think, with a few hooks to prefer reschedule > on the same CPU. > > Context switching is done with the > gotolabel() > setlabel() > mmuswtich() > taskswitch() > > > On Jun 21, 2014, at 12:30 PM, yan cui wrote: > >> Hi all, >> >> On SMP or multicore systems, what algorithm(s) does Plan 9 use to sc= hedule(context switching and load balancing) different tasks (process or th= read) and where is it implemented? I searched some plan9 documents, but can= not find some about this topic. Any recommendations? >> >> >> Thanks, Yan >> >> -- >> Think big; Dream impossible; Make it happen. > >