Re: spinlocks on powerpc - Mailing list pgsql-hackers

From Manabu Ori
Subject Re: spinlocks on powerpc
Date
Msg-id 892AF2DE-F6DC-463B-A9D2-87FC8B748E61@gmail.com
Whole thread Raw
In response to Re: spinlocks on powerpc  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: spinlocks on powerpc  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom, thank you for your advise.

On 2012/01/01, at 3:39, Tom Lane wrote:

> What I suggest we should do about this is provide an overridable option
> in pg_config_manual.h, along the lines of
>
>     #if defined(__ppc64__) || defined(__powerpc64__)
>     #define USE_PPC_LWARX_MUTEX_HINT
>     #endif
>
> and then test that symbol in s_lock.h.  This will provide an escape
> hatch for anyone who doesn't want the decision tied to 64-bit-ness,
> while still enabling the option automatically for the majority of
> people who could use it.

Fair enough.
I recreated the patch as you advised.

> BTW, while reading the ISA document I couldn't help noticing that LWARX
> is clearly specified to operate on 4-byte quantities (there's LDARX if
> you want to use 8-byte).  Which seems to mean that this bit in s_lock.h
> just represents bogus waste of space:
>
> #if defined(__ppc64__) || defined(__powerpc64__)
> typedef unsigned long slock_t;
> #else
> typedef unsigned int slock_t;
> #endif
>
> Shouldn't we just make slock_t be "int" for both PPC and PPC64?

I'd like it to be untouched for this TAS_SPIN for powerpc
discussion, since it seems it remainds like this for several
years and maybe it needs some more careful consideration
especially for sign extension…

Regards,
Manabu Ori
Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: spinlocks on powerpc
Next
From: Pavel Stehule
Date:
Subject: Re: review: CHECK FUNCTION statement