Re: LWLock optimization for multicore Power machines

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
Cc: Bernd Helmle <mailings(at)oopsware(dot)de>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: LWLock optimization for multicore Power machines
Date: 2017-03-31 22:36:04
Message-ID: 10419.1490999764@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru> writes:
>> It seems that on this platform definition of atomics should be provided by
>> fallback.h. But it doesn't because I already defined PG_HAVE_ATOMIC_U32_SUPPORT
>> in arch-ppc.h. I think in this case we shouldn't provide ppc-specific
>> implementation of pg_atomic_fetch_mask_add_u32(). However, I don't know
>> how to do this assuming arch-ppc.h is included before compiler-specific
>> headers. Thus, in arch-ppc.h we don't know yet if we would find
>> implementation of atomics for this platform. One possible solution is to
>> provide assembly implementation for all atomics in arch-ppc.h.

> BTW, implementation for all atomics in arch-ppc.h would be too invasive and
> shouldn't be considered for v10.
> However, I made following workaround: declare pg_atomic_uint32 and
> pg_atomic_fetch_mask_add_u32_impl() only when we know that generic-gcc.h
> would declare gcc-based atomics.

I don't have a well-informed opinion on whether this is a reasonable thing
to do, but I imagine Andres does.

> Could you, please, check it on Apple PPC?

It does compile and pass "make check" on prairiedog.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2017-03-31 22:44:17 Re: Somebody has not thought through subscription locking considerations
Previous Message Peter Geoghegan 2017-03-31 22:26:22 Re: Partitioning vs ON CONFLICT