List:Falcon Storage Engine« Previous MessageNext Message »
From:Xuekun Hu Date:February 4 2009 3:30am
Subject:RE: Problems with record visibility and how it is computed
View as plain text  
>My performance testing suggests that on Intel and AMD, an interlocked
>CAS is cheaper than an interlocked increment or decrement.  I suspect
>this is because the interlocked CAS is a single memory operation that
>either succeeds or fails in the memory controller while the interlocked
>increment (actually a "add 1 to memory") requires a memory bus lock
>while the processors fetches the operand, does the add, and writes it back.

>This further suggests that we might get some bang by replacing our
>interlocked increment and decrement with interlocked CASes.

Jim, our internal measurements showed almost same latency for both
the interlocked CAS (lock cmpxchg) and interlocked increment (lock xadd
or atomic incr). Both operations have to do the same thing by fetching the
line with ownership, locking, modifying and writing it back.

Thx, Xuekun

-----Original Message-----
From: Jim Starkey [mailto:jstarkey@stripped]
Sent: Thursday, January 29, 2009 3:38 AM
To: Olav Sandstaa
Cc: Kevin Lewis; FalconDev
Subject: Re: Problems with record visibility and how it is computed

Olav Sandstaa wrote:
>>
>> There isn't much difference in cost between a lock(Shared)/unlock and
>> addRef/release.  Each requires a pair of interlocked instructions.
>
> Thanks for the clearification about the cost. I expected the interlock
> instruction to be relatively cheaper than a shared lock.
>
>
My performance testing suggests that on Intel and AMD, an interlocked
CAS is cheaper than an interlocked increment or decrement.  I suspect
this is because the interlocked CAS is a single memory operation that
either succeeds or fails in the memory controller while the interlocked
increment (actually a "add 1 to memory") requires a memory bus lock
while the processors fetches the operand, does the add, and writes it back.

This further suggests that we might get some bang by replacing our
interlocked increment and decrement with interlocked CASes.


--
Jim Starkey
President, NimbusDB, Inc.
978 526-1376


--
Falcon Storage Engine Mailing List
For list archives: http://lists.mysql.com/falcon
To unsubscribe:    http://lists.mysql.com/falcon?unsub=1

Thread
Problems with record visibility and how it is computedOlav Sandstaa21 Jan
  • search for null values in indexed columnsVladislav Vaintroub21 Jan
    • Re: search for null values in indexed columnsLars-Erik Bjørk21 Jan
    • Re: search for null values in indexed columnsKevin Lewis21 Jan
      • RE: search for null values in indexed columnsVladislav Vaintroub21 Jan
        • Re: search for null values in indexed columnsKevin Lewis21 Jan
      • Re: search for null values in indexed columnsJames Day23 Jan
  • Re: Problems with record visibility and how it is computedOlav Sandstaa23 Jan
    • Re: Problems with record visibility and how it is computedJim Starkey23 Jan
      • Re: Problems with record visibility and how it is computedKevin Lewis28 Jan
        • Re: Problems with record visibility and how it is computedJim Starkey28 Jan
          • Re: Problems with record visibility and how it is computedKevin Lewis28 Jan
            • Cycle Locking (was Problems with record visibility and how it iscomputed)Jim Starkey28 Jan
            • Re: Problems with record visibility and how it is computedAnn W. Harrison28 Jan
              • Re: Problems with record visibility and how it is computedJim Starkey28 Jan
                • Re: Problems with record visibility and how it is computedAnn W. Harrison28 Jan
                  • Re: Problems with record visibility and how it is computedOlav Sandstaa26 Feb
                    • New Transaction State object (Was: Problems with record visibility andhow it is computed)Olav Sandstaa16 Mar
                      • Re: New Transaction State object (Was: Problems with record visibilityand how it is computed)Kevin Lewis16 Mar
                      • Re: New Transaction State object (Was: Problems with record visibilityand how it is computed)Jim Starkey16 Mar
                        • Re: New Transaction State object (Was: Problems with record visibilityand how it is computed)Olav Sandstaa19 Mar
                          • Re: New Transaction State object (Was: Problems with record visibilityand how it is computed)Jim Starkey19 Mar
                            • RE: New Transaction State object (Was: Problems with record visibilityand how it is computed)Vladislav Vaintroub20 Mar
                            • Re: New Transaction State object (Was: Problems with record visibilityand how it is computed)Olav Sandstaa20 Mar
                              • Re: New Transaction State object (Was: Problems with record visibilityand how it is computed)Jim Starkey20 Mar
          • Re: Problems with record visibility and how it is computedOlav Sandstaa28 Jan
            • Re: Problems with record visibility and how it is computedJim Starkey28 Jan
              • Another Idea for Transaction Lifetime ControlJim Starkey28 Jan
                • Re: Another Idea for Transaction Lifetime ControlJim Starkey29 Jan
              • RE: Problems with record visibility and how it is computedXuekun Hu4 Feb
          • Re: Problems with record visibility and how it is computedAnn W. Harrison28 Jan
  • Quick question on row countsKeith Murphy24 Jan
    • Re: Quick question on row countsJim Starkey25 Jan
      • Re: Quick question on row countsKeith Murphy25 Jan