From owner-freebsd-smp Mon Nov 25 16:39:26 1996 Return-Path: owner-smp Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id QAA23069 for smp-outgoing; Mon, 25 Nov 1996 16:39:26 -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 QAA23044 for ; Mon, 25 Nov 1996 16:38:43 -0800 (PST) Received: from spinner.DIALix.COM (peter@localhost.DIALix.oz.au [127.0.0.1]) by spinner.DIALix.COM (8.8.3/8.8.3) with ESMTP id IAA02227; Tue, 26 Nov 1996 08:35:43 +0800 (WST) Message-Id: <199611260035.IAA02227@spinner.DIALix.COM> To: Steve Passe cc: Poul-Henning Kamp , 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 10:05:58 MST." <199611251705.KAA01825@clem.systemsix.com> Date: Tue, 26 Nov 1996 08:35:42 +0800 From: Peter Wemm Sender: owner-smp@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Steve Passe wrote: > Hi, > > > > Going this way eliminates (for each reference to curproc): > > ... > > I thought of a shortcut for this awhile back but never tried it. Any code that > > is running inside the kernel and currently has the lock could skip this and > > determine which cpu it is with: > > > > #define LOCKED_CPUNUM() ((mp_lock & 0x0f000000) >> 24) > > > > you still have the shift, but the APIC access is eliminated. > gotto have my first cup of coffee b4 trying to think. This is not quite righ t, > still need the phyToLog indirection, the mplock uses physical CPU#. But it > does eliminate the APIC access, the most expensive part of the current call. Yes, I know the feeling. :-) I'm having a very slow start this morning too. Just as well Netscape sent me a double-sized coffee mug.. :-) BTW, I would like to change the mplocking to use the logical cpu numbering, since that's the only place left where it takes the physical number. Going via a private page mechanism means we can do this easily since we can supply a pre-shifted, masked and translated 32 bit int with the logical cpu number in 0x0N000000. > -- > Steve Passe | powered by > smp@csn.net | FreeBSD > Cheers, -Peter