Re: New statistics for WAL buffer dirty writes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Satoshi Nagayasu <snaga(at)uptime(dot)jp>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New statistics for WAL buffer dirty writes
Date: 2012-08-01 14:12:14
Message-ID: 2548.1343830334@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Tue, Jul 31, 2012 at 4:06 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I agree that volatile-izing everything in the vicinity is a sucky
>> solution, but the last time we looked at this there did not seem to
>> be a better one.

> Well, Linux has a barrier() primitive which is defined as a
> compiler-barrier, so I don't see why we shouldn't be able to manage
> the same thing. In fact, we've already got it, though it's presently
> unused; see storage/barrier.h.

Solving the problem for linux only, or gcc only, isn't going to get us
to a place where we can stop volatile-izing call sites. We need to be
sure it works for every single case supported by s_lock.h.

I think you may be right that using __asm__ __volatile__ in gcc
S_UNLOCK cases would be a big step forward, but it needs more research
to see if that's the only fix needed.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2012-08-01 14:14:45 Re: Help me develop new commit_delay advice
Previous Message Robert Haas 2012-08-01 14:07:33 Re: New statistics for WAL buffer dirty writes