From owner-freebsd-smp Mon Nov 25 04:39:00 1996 Return-Path: owner-smp Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id EAA12513 for smp-outgoing; Mon, 25 Nov 1996 04:39:00 -0800 (PST) Received: from spinner.DIALix.COM (root@spinner.DIALix.COM [192.203.228.67]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id EAA12508 for ; Mon, 25 Nov 1996 04:38:47 -0800 (PST) Received: from spinner.DIALix.COM (peter@localhost [127.0.0.1]) by spinner.DIALix.COM (8.8.3/8.8.3) with ESMTP id UAA00709; Mon, 25 Nov 1996 20:38:16 +0800 (WST) Message-Id: <199611251238.UAA00709@spinner.DIALix.COM> To: Poul-Henning Kamp cc: freebsd-smp@freebsd.org Subject: Re: cvs commit: sys/i386/i386 locore.s swtch.s sys/i386/include pmap.h In-reply-to: Your message of "Mon, 25 Nov 1996 12:55:26 +0100." <1712.848922926@critter.tfs.com> Date: Mon, 25 Nov 1996 20:38:15 +0800 From: Peter Wemm Sender: owner-smp@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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