Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Nov 1996 20:38:15 +0800
From:      Peter Wemm <peter@spinner.dialix.com>
To:        Poul-Henning Kamp <phk@critter.tfs.com>
Cc:        freebsd-smp@freebsd.org
Subject:   Re: cvs commit: sys/i386/i386 locore.s swtch.s sys/i386/include pmap.h 
Message-ID:  <199611251238.UAA00709@spinner.DIALix.COM>
In-Reply-To: Your message of "Mon, 25 Nov 1996 12:55:26 %2B0100." <1712.848922926@critter.tfs.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
Poul-Henning Kamp wrote:
> >  Log:
> >  Implement part 1 of per-cpu private pages.
> 
> You'd better get dyson rolled out right away...  ;-)

Yeah, I've spoken to DG on and off about this, and each time we talked
about it we ended up at the conclusion that it was a bit of a kludge
but it was probably the most efficient way of doing it.

The main difference between this and the previous implementation that
we started with the first time, is that this is outside kvm space.  The
original code "stole" a PDE slot (entry number 59 of 63 in kernel space
from memory), and kept bashing it back in over and over again.  I think
that what I've done here is the least ugly way way of approaching this,
hopefully keeping the kludges to a minimum.

And yes, there are short-term kludges present that will go away shortly,
so don't shoot me just yet for what I did in swtch.s... :-)  It's MUCH
cleaner than it was as we got it from the original code.

I hope John's not going to have too much of a heart attack.. :-]  It doesn't
interfere with the pmap code or the vm system in general, apart from making
the maximum npkt space smaller by 4MB.  I'm pretty sure I can get this
to fly tonight, and will probably be able to get rid of the idle procs
and smp_idleloop() in the process.

I know I certainly prefer:

extern struct proc *curproc;
extern int cpu_id;

To this:

extern struct proc*             SMPcurproc[ NCPU ];
extern int                      apicIdToLogical[];
extern volatile u_int*          apic_base;

static __inline unsigned                                                        
cpunumber(void)
{
  return (unsigned)(apicIdToLogical[ (apic_base[8] & 0x0f000000) >> 24 ]);
}

#define curproc (SMPcurproc[cpunumber()])
#define cpu_id (cpunumber())

Cheers,
-Peter



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