Re: removing volatile qualifiers from lwlock.c

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: removing volatile qualifiers from lwlock.c
Date: 2014-09-19 18:05:14
Message-ID: 20140919180514.GC13527@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-09-19 13:58:17 -0400, Robert Haas wrote:
> On Wed, Sep 17, 2014 at 7:45 AM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> > I just tried this on my normal x86 workstation. I applied your lwlock
> > patch and ontop I removed most volatiles (there's a couple still
> > required) from xlog.c. Works for 100 seconds. Then I reverted the above
> > commits. Breaks within seconds:
> > master:
> > LOG: request to flush past end of generated WAL; request 2/E5EC3DE0, currpos 2/E5EC1E60
> > standby:
> > LOG: record with incorrect prev-link 4/684C3108 at 4/684C3108
> > and similar.
> >
> > So at least for x86 the compiler barriers are obviously required and
> > seemingly working.
>
> Oh, that's great. In that case I think I should go ahead and apply
> that patch in the hopes of turning up any systems where the barriers
> aren't working properly yet.

Agreed.

> Although it would be nice to know whether it breaks with *only* the lwlock.c patch.

It didn't, at least not visibly within the 1000s I let pgbench run.

> > I've attached the very quickly written xlog.c de-volatizing patch.
>
> I don't have time to go through this in detail, but I don't object to
> you applying it if you're confident you've done it carefully enough.

It's definitely not yet carefully enough checked. I wanted to get it
break fast and only made one pass through the file. But I think it
should be easy enough to get it into shape for that.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2014-09-19 18:05:32 Re: B-Tree support function number 3 (strxfrm() optimization)
Previous Message Robert Haas 2014-09-19 18:04:39 Re: Turning off HOT/Cleanup sometimes