Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqPAg-0001xh-Bl for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Apr 2016 18:05:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aqPAf-00035V-QL for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Apr 2016 18:05:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aqP9J-0001Vx-TB for pgsql-hackers@postgresql.org; Wed, 13 Apr 2016 18:04:21 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aqP9H-0005uc-0s for pgsql-hackers@postgresql.org; Wed, 13 Apr 2016 18:04:21 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id EB36E213AE for ; Wed, 13 Apr 2016 14:04:17 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Wed, 13 Apr 2016 14:04:17 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=tPH3EXl2/Q8UKMCr9V0EpRQUoh8=; b=ShBAz zQThyyefOFgqGmuA7+UljFzufEZsmaxIe/hJk3Wgcfcj4LFlkzqNEy2nac6tspmq xXCpmbu1S28wmknwRTIywS1OWe498PfMcFc+E7tOrkxkyg4F1yRYQUdNz9Z1GmUo UKNdToXKVan0hvxqaiSs1HiRjVmV/q0GBh4t3s= X-Sasl-enc: UNej2D/vurm4plqhcxGGGPuG1+wXLp3JQOEixTDwrw/7 1460570657 Received: from intern.anarazel.de (unknown [184.23.178.130]) by mail.messagingengine.com (Postfix) with ESMTPA id A35DDC0001A; Wed, 13 Apr 2016 14:04:17 -0400 (EDT) Date: Wed, 13 Apr 2016 11:04:14 -0700 From: Andres Freund To: Tom Lane Cc: pgsql-hackers@postgresql.org Subject: Re: [COMMITTERS] pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner. Message-ID: <20160413180414.b3cbliwgzrfinxg3@alap3.anarazel.de> References: <1881.1460431476@sss.pgh.pa.us> <4369.1460435533@sss.pgh.pa.us> <20160412050038.ua2avkwi6dxxcjhx@alap3.anarazel.de> <32012.1460472131@sss.pgh.pa.us> <3736.1460476321@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3736.1460476321@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers