Re: [COMMITTERS] pgsql: Do all accesses to shared buffer headers through

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [COMMITTERS] pgsql: Do all accesses to shared buffer headers through
Date: 2005-10-17 21:48:49
Message-ID: 20051017214849.GY86144@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Wed, Oct 12, 2005 at 10:46:14PM -0400, Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Does any of this need to be backpatched?
>
> No --- we didn't have any per-buffer spinlocks before 8.1.
>
> It's possible that at some point we'll need to start thinking about
> applying volatile-pointer coding rules to data structures protected by
> LWLocks. This could only become an issue if the compiler (a) inlines
> LWLockAcquire/Release, and (b) tries to rearrange loads and stores
> around the LWLock code. I would like to think that the latter is
> impossible even with inlining, principally because the compiler can't
> ignore the kernel calls that may occur within the LWLock routines;
> those should be treated as external function calls and hence sequence
> points, no matter how aggressive the compiler gets. But we'll see.

Sorry if I'm just confused here, but don't LWLocks protect data
structures susceptible to corruption? And if that's the case don't we
need to be sure that the compiler can't optimize around them? Or will
this only result in things like buffers not getting un-pinned?
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2005-10-18 01:06:24 pgsql: A few trivial code cleanups motivated by reading warnings
Previous Message User Ahatzis 2005-10-17 17:17:17 press - pr: First German version of release text (prior version was

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2005-10-17 23:25:25 Re: Seeing context switch storm with 10/13 snapshot of
Previous Message Jim C. Nasby 2005-10-17 21:41:19 Re: A costing analysis tool