Re: spinlocks on HP-UX - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: spinlocks on HP-UX
Date
Msg-id 20111228.210344.2067578588617654319.t-ishii@sraoss.co.jp
Whole thread Raw
In response to Re: spinlocks on HP-UX  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: spinlocks on HP-UX  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
>> With help from IBM Japan Ltd. we did some tests on a larger IBM
>> machine than Tom Lane has used for his
>> test(http://archives.postgresql.org/message-id/8292.1314641721@sss.pgh.pa.us).
>> In his case it was IBM 8406-71Y, which has 8 physical cores and
>> 4SMT(32 threadings). Ours is IBM Power 750 Express, which has 32
>> physical cores and 4SMT(128 threadings), 256GB RAM.
>>
>> The test method was same as the one in the article above. The
>> differences are OS(RHEL 6.1), gcc version (4.4.5) and shared buffer
>> size(8GB).
>>
>> We tested 3 methods to enhance spin lock contention:
>>
>> 1) Add "hint" parameter to lwarx op which is usable POWER6 or later
>>   architecure.
>>
>> 2) Add non-locked test in TAS()
>>
>> 3) #1 + #2
>>
>> We saw small performance enhancement with #1, larger one with #2 and
>> even better with #1+#2.
>
> Hmm, so you added the non-locked test in TAS()?  Did you try adding it
> just to TAS_SPIN()?  On Itanium, I found that it was slightly better
> to do it only in TAS_SPIN() - i.e. in the contended case.

Here is new patch using TAS_SPIN(), created by Manabu Ori from IBM
Japan. Also this patch deal with older Power architectures which do
not have "hint" argument of lwarx opcode.

According to him, the patch resulted in much better performance stock
git head.

Stock git head without patch:
pgbench -c 1 -j 1 -S -T 300    tps = 11360.472691 (including ...
pgbench -c 2 -j 1 -S -T 300    tps = 22173.943133 (including ...
pgbench -c 4 -j 2 -S -T 300    tps = 43397.331641 (including ...
pgbench -c 8 -j 4 -S -T 300    tps = 73469.073714 (including ...
pgbench -c 16 -j 8 -S -T 300   tps = 151094.270443 (including ...
pgbench -c 32 -j 16 -S -T 300  tps = 166752.637452 (including ...
pgbench -c 64 -j 32 -S -T 300  tps = 148139.338204 (including ...
pgbench -c 128 -j 64 -S -T 300 tps = 115412.622895 (including ...

Stock git head with patch:
pgbench -c 1 -j 1 -S -T 300    tps = 11103.370854 (including ...
pgbench -c 2 -j 1 -S -T 300    tps = 22118.907582 (including ...
pgbench -c 4 -j 2 -S -T 300    tps = 42608.641820 (including ...
pgbench -c 8 -j 4 -S -T 300    tps = 77592.862639 (including ...
pgbench -c 16 -j 8 -S -T 300   tps = 150469.841892 (including ...
pgbench -c 32 -j 16 -S -T 300  tps = 267726.082168 (including ...
pgbench -c 64 -j 32 -S -T 300  tps = 322582.271713 (including ...
pgbench -c 128 -j 64 -S -T 300 tps = 273071.683663 (including ...

(Graph is attached)

Test environment:
Power 750 (32 physical cores, virtually 128 cores using SMT4)
mem: 256GB
OS: RHEL6.1 kernel 2.6.32-131.0.15.el6.ppc64
gcc version 4.4.5 20110214 (Red Hat 4.4.5-6)
PostgreSQL Git head (0510b62d91151b9d8c1fe1aa15c9cf3ffe9bf25b)
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Pause at end of recovery
Next
From: Alvaro Herrera
Date:
Subject: Re: pgstat wait timeout