Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 May 2002 09:43:22 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Peter Jeremy <peter.jeremy@alcatel.com.au>
Cc:        cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/kern kern_mutex.c
Message-ID:  <XFMail.20020523094322.jhb@FreeBSD.org>
In-Reply-To: <20020523161537.A10471@gsmx07.alcatel.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help

On 23-May-2002 Peter Jeremy wrote:
> On 2002-May-21 15:26:36 -0700, John Baldwin <jhb@FreeBSD.ORG> wrote:
>>  Add appropriate IA32 "pause" instructions to improve performanec on
>>  Pentium 4's and newer IA32 processors.  The "pause" instruction has been
>>  verified by Intel to be a NOP on all currently existing IA32 processors
>>  prior to the Pentium 4.
> 
> What about non-Intel iA32 look-alikes?  And does "currently existing
> IA32 processors" mean everything back to the 80386, or just Pentium
> and later (when Intel started using the "iA32" name)?

In Intel's documentation they said that all current look-alikes worked as
well.  It's the opcode for 'rep mov'.  I am curious if some implementations
trash %ecx, and if we are paranoid we could always clobber %ecx in the
constraints.  I think IA32 just goes back to the 386, but FreeBSD doesn't
run on 8086, 80186, or 80826's anyways.  The quote from the Intel manual
about using 'pause' to optimize spinlocks is:

Btw, the number for this PDF is: 248674-001

"On the Pentium 4 processor, the instruction behaves as described above,
resulting in a net performance improvement.  However for all known
existing IA-32 processors the instruction is interpreted as a NOP (no
operation) and does not affect the program in any way.  It has been
verified that PAUSE is a NOP for all known Intel architectures
prior to the Pentium 4 processor.  It is even known to behave as a NOP
on the non-Intel x86 family processors that were available at the time
of testing."

> Peter

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

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




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