Re: [COMMITTERS] pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner. - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [COMMITTERS] pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.
Date
Msg-id 20160413180414.b3cbliwgzrfinxg3@alap3.anarazel.de
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [COMMITTERS] pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2016-04-12 11:52:01 -0400, Tom Lane wrote:
> I wrote:
> > It looks like that compiler adheres to the C89 restriction that an
> > initializer for an array or struct must contain only link-time-constant
> > expressions, even if the target object is of dynamic scope.
> > The macro works with a link-time-constant pointer argument, but not
> > with one that must be evaluated at runtime.
> 
> It strikes me that that means you could stick with this initialization
> method if you made the macro argument be a literal constant string name,
> like "buffer spinlock", and printed that rather than the address in
> s_lock_stuck.  This would be different from what we do now, but not
> necessarily any less useful.

I'm not sure anybody really benefits from those addresses; I guess the
idea was that they'd allow you to figure out which exact spinlock got
stuck; file + line doesn't necessarily help there. But it doesn't seem
super useful, ASLR makes the addesses unpredictable, so you need a core
file anyway - in which case you can just walk the stack.

So I think I'm on board with replacing the argument; although I'm
wondering if we shouldn't just remove it entirely, rather than replacing
it with a string that's likely just going to duplicate the file/line
information.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: SET ROLE and reserved roles
Next
From: Tom Lane
Date:
Subject: Re: SET ROLE and reserved roles