Re: [PATCHES] update i386 spinlock for hyperthreading

From: Manfred Spraul <manfred(at)colorfullife(dot)com>
To: ohp(at)pyrenet(dot)fr
Cc: pgsql-hackers list <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] update i386 spinlock for hyperthreading
Date: 2003-12-27 19:03:10
Message-ID: 3FEDD76E.6080304@colorfullife.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-patches

ohp(at)pyrenet(dot)fr wrote:

>Hi Manfred,
>
>I'm using unixware 7 but couldn't compile your source with native cc, I
>had to compile it with gcc.
>
>here are the results:
>
>
Thanks. The test app compares the time needed for three different short
loops: a loop with six empty function calls, a loop with six function
calls and one nop in the middle, and a loop with a "rep;nop;" in the middle.

Result:
- nop needs 0 cycles - executed in parallel.
- rep;nop between 24 and 60 cycles - long enough that the pipeline is
emptied.

I've searched around for further info regarding the recommended spinlock
algorithm:
- The optimization manual (google for "Intel 248966") contains a section
about pause instructions: The memory ordering violation is from the
multiple simultaneous reads that are executed due to pipelining the busy
loop.
- It references the Application Note AP-949 "Using Spin-Loops on Intel
Pentium 4 Processor and Intel Xeon Processor" for further details.
Unfortunately the app notes are stored on cedar.intel.com, and that
server appears to be down :-(

--
Manfred

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nailah Ogeer 2003-12-27 19:08:16 Connecting to Postgres
Previous Message Uwe C. Schroeder 2003-12-27 18:31:11 Re: Is my MySQL Gaining ?

Browse pgsql-hackers by date

  From Date Subject
Next Message Nailah Ogeer 2003-12-27 19:08:16 Connecting to Postgres
Previous Message ivan 2003-12-27 18:47:54 Re: new-line

Browse pgsql-patches by date

  From Date Subject
Next Message Nailah Ogeer 2003-12-27 19:08:16 Connecting to Postgres
Previous Message Bruce Momjian 2003-12-27 18:26:28 Re: Quoting of psql \d output