test-and-set for s390x and powerpc64

Lists: pgsql-patches
From: Reinhard Max <max(at)suse(dot)de>
To: pgsql-patches(at)postgresql(dot)org
Subject: test-and-set for s390x and powerpc64
Date: 2002-10-31 16:08:29
Message-ID: Pine.LNX.4.44.0210311648230.14190-300000@wotan.suse.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Hi,

the attached patches provide test-and-set assembler code for s390x
(64bit) and ppc64.

The s390x patch changes the existing implementation to a more
efficient version (according to the IBM guy who wrote it), that works
on both s390 architectures. It also changes the -fpic compiler flag to
-fPIC which is needed for some Linux platforms, and AFAIK doesn't hurt
on the others.

cu
Reinhard

Attachment Content-Type Size
postgresql-s390x.patch text/plain 849 bytes
postgresql-ppc64.patch text/plain 950 bytes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Reinhard Max <max(at)suse(dot)de>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: test-and-set for s390x and powerpc64
Date: 2002-10-31 17:17:16
Message-ID: 7869.1036084636@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Reinhard Max <max(at)suse(dot)de> writes:
> the attached patches provide test-and-set assembler code for s390x
> (64bit) and ppc64.

Why do we need that ppc64 code? It appears identical to the ppc code
(except for missing isync, which means it's broken on multi-CPU boxes).

> It also changes the -fpic compiler flag to
> -fPIC which is needed for some Linux platforms, and AFAIK doesn't hurt
> on the others.

Evidence?

regards, tom lane


From: Reinhard Max <max(at)suse(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: test-and-set for s390x and powerpc64
Date: 2002-10-31 17:23:59
Message-ID: Pine.LNX.4.44.0210311817420.10694-100000@wotan.suse.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On Thu, 31 Oct 2002 at 12:17, Tom Lane wrote:

> Reinhard Max <max(at)suse(dot)de> writes:
> > the attached patches provide test-and-set assembler code for s390x
> > (64bit) and ppc64.
>
> Why do we need that ppc64 code? It appears identical to the ppc
> code (except for missing isync, which means it's broken on multi-CPU
> boxes).

I'll re-check that with the ppc architecture guy here.

> > It also changes the -fpic compiler flag to -fPIC which is needed
> > for some Linux platforms, and AFAIK doesn't hurt on the others.
>
> Evidence?

Shared libraries don't work on the S/390 platforms unless compiled
with -fPIC. The lowercase -fpic is not sufficient there. I don't
remember the details, but the architecture gurus told me that -fPIC is
strictly needed. Here at SuSE all shared libs on all platforms get
built with -fPIC .

cu
Reinhard


From: Reinhard Max <max(at)suse(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: test-and-set for s390x and powerpc64
Date: 2002-11-05 08:54:00
Message-ID: Pine.LNX.4.44.0211050948001.25391-100000@wotan.suse.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On Thu, 31 Oct 2002 at 18:23, Reinhard Max wrote:

> On Thu, 31 Oct 2002 at 12:17, Tom Lane wrote:
>
> > Why do we need that ppc64 code? It appears identical to the ppc
> > code

The difference is the symbol name ("tas" vs. ".tas") which is needed
because of the different ABIs of ppc and ppc64.

> > (except for missing isync, which means it's broken on multi-CPU
> > boxes).

This was indeed a bug.

> I'll re-check that with the ppc architecture guy here.

... he is now about to write an inlined version that can go into
s_lock.h . I'll send the new patch later on...

cu
Reinhard


From: Reinhard Max <max(at)suse(dot)de>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: test-and-set for s390x and powerpc64
Date: 2002-11-07 08:43:05
Message-ID: Pine.LNX.4.44.0211070916210.7551-200000@wotan.suse.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On Tue, 5 Nov 2002 at 09:54, Reinhard Max wrote:

> > I'll re-check that with the ppc architecture guy here.
>
> ... he is now about to write an inlined version that can go into
> s_lock.h . I'll send the new patch later on...

OK, here it comes:

An inlined version of tas(), that works for both, powerpc and
powerpc64. The patch is against 7.3b5 and passes the test suite on
both architectures.

cu
Reinhard

Attachment Content-Type Size
postgresql-ppc-tas.patch text/plain 1.7 KB

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Reinhard Max <max(at)suse(dot)de>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: test-and-set for s390x and powerpc64
Date: 2002-11-08 04:34:03
Message-ID: 200211080434.gA84Y3I27930@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


Too late for 7.3, especially because it affects our existing PPC tas code.

This has been saved for the 7.4 release:

http:/momjian.postgresql.org/cgi-bin/pgpatches2

---------------------------------------------------------------------------

Reinhard Max wrote:
> On Tue, 5 Nov 2002 at 09:54, Reinhard Max wrote:
>
> > > I'll re-check that with the ppc architecture guy here.
> >
> > ... he is now about to write an inlined version that can go into
> > s_lock.h . I'll send the new patch later on...
>
> OK, here it comes:
>
> An inlined version of tas(), that works for both, powerpc and
> powerpc64. The patch is against 7.3b5 and passes the test suite on
> both architectures.
>
> cu
> Reinhard

Content-Description:

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Reinhard Max <max(at)suse(dot)de>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: test-and-set for s390x and powerpc64
Date: 2002-11-10 00:33:57
Message-ID: 200211100033.gAA0Xvs07001@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


Patch applied to 7.4. Sorry we couldn't get it into 7.3. (Too risky.)

Thanks.

---------------------------------------------------------------------------

Reinhard Max wrote:
> On Tue, 5 Nov 2002 at 09:54, Reinhard Max wrote:
>
> > > I'll re-check that with the ppc architecture guy here.
> >
> > ... he is now about to write an inlined version that can go into
> > s_lock.h . I'll send the new patch later on...
>
> OK, here it comes:
>
> An inlined version of tas(), that works for both, powerpc and
> powerpc64. The patch is against 7.3b5 and passes the test suite on
> both architectures.
>
> cu
> Reinhard

Content-Description:

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073