Re: New statistics for WAL buffer dirty writes
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Jeff Janes <jeff.janes@gmail.com>, Satoshi Nagayasu <snaga@uptime.jp>, Pgsql Hackers <pgsql-hackers@postgresql.org>
Date: 2012-08-01T14:12:14Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes: > On Tue, Jul 31, 2012 at 4:06 PM, Tom Lane <tgl@sss.pgh.pa.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