Re: [COMMITTERS] pgsql: Improve 64bit atomics support.

From: Andres Freund <andres(at)anarazel(dot)de>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Improve 64bit atomics support.
Date: 2017-04-08 00:18:35
Message-ID: 20170408001835.o5yg3t62zewcxhv6@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 2017-04-07 16:36:09 -0700, Andres Freund wrote:
> On 2017-04-07 19:55:21 -0300, Alvaro Herrera wrote:
> > Andres Freund wrote:
> > > Improve 64bit atomics support.
> > >
> > > When adding atomics back in b64d92f1a, I added 64bit support as
> > > optional; there wasn't yet a direct user in sight. That turned out to
> > > be a bit short-sighted, it'd already have been useful a number of times.
> >
> > Seems like this killed an arapaima:
> > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=arapaima&dt=2017-04-07%2022%3A06%3A59
> >
> > Program terminated with signal 6, Aborted.
> > #0 0x00c6a402 in __kernel_vsyscall ()
> > #0 0x00c6a402 in __kernel_vsyscall ()
> > #1 0x00284b10 in raise () from /lib/libc.so.6
> > #2 0x00286421 in abort () from /lib/libc.so.6
> > #3 0x084d967e in ExceptionalCondition (
> > conditionName=0xe19dac "(((uintptr_t) ((uintptr_t)(ptr)) + ((8) - 1)) & ~((uintptr_t) ((8) - 1))) != (uintptr_t)(ptr)",
> > errorType=0xe19831 "UnalignedPointer",
> > fileName=0xe19d88 "../../../src/include/port/atomics.h", lineNumber=428)
> > at assert.c:54
> > #4 0x00e189b0 in pg_atomic_init_u64 ()
> > at ../../../src/include/port/atomics.h:428
>
> Gah, that's fairly annoying :(. We can't trivially force alignment in
> the generic fallback case, because not all compilers support that. We
> don't really need it the fallback case, because things are protected by
> a lock - but that means we'll have to make a bunch of locks conditional
> :/

Pushed an attempt at fixing this along those lines, let's hope that
works.

- Andres

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2017-04-08 00:19:09 Re: pgsql: Improve 64bit atomics support.
Previous Message Andres Freund 2017-04-08 00:16:42 pgsql: Fix issues in e8fdbd58fe.

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-04-08 00:19:09 Re: pgsql: Improve 64bit atomics support.
Previous Message Keith Fiske 2017-04-08 00:02:31 Re: Partitioned tables vs GRANT