Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Aug 1999 18:55:16 +0800
From:      Peter Wemm <peter@netplex.com.au>
To:        Alan Cox <alc@cs.rice.edu>
Cc:        "Josep Maria M. Blanquer" <blanquer@cs.ucsb.edu>, freebsd-smp@freebsd.org
Subject:   Re: Questions 
Message-ID:  <19990813105516.B09681C1E@overcee.netplex.com.au>
In-Reply-To: Your message of "Thu, 12 Aug 1999 18:17:00 EST." <19990812181700.B27359@nonpc.cs.rice.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help
Alan Cox wrote:
> On Wed, Aug 11, 1999 at 08:01:14AM -0700, Josep Maria M. Blanquer wrote:
> > ...
> >
> >   2- The other question is the use of lastcpu field on proc structure:
> >      I've seen that the field is being updated on cpu_switch() but
> >      I couldn't find any place where the field is being used. Is this
> >      a pending work? I mean there is or has been any work on SMP
> >      specific scheduling? I mean, process balancing, local/global queues
> >      and so on?
> >
> 
> Try asking John Dyson (dyson@iquest.net).  I think he has
> experimented with some limited forms of affinity scheduling.

I've done this BTW and have it currently running.  I've turned up a bug or
two that look awfully like something is changing p->p_priority of processes
while they are on run queues.

Even doing trivial affinity makes a big difference here.  Trivial meaning
that when selecting a process to run, walk the current run queue level and
find the first process with a matching lastcpu id rather than just the
first in the queue.  If no match, then take the head.  This is what John
did, but I rewrote setrunqueue, remrq in C and moved the process selection
out of i386/swtch.s and into C.  The compiler generates suprisingly similar
code to the assembler version, but when you turn on the U/V pipeline
scheduling and the cpu-specific code generation options (eg: use cmove etc)
then it seems to do slightly better than the original assembler code.

This dramatically simplifies the complexity of cpu_switch() and swtch.s
and moves the run queue management to MI code.  All that is left in
cpu_switch() is the actual context switch code.

> 	Alan

Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990813105516.B09681C1E>