Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1asAJC-00084U-7w for pgsql-committers@arkaria.postgresql.org; Mon, 18 Apr 2016 14:37:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1asAJB-00085d-Qt for pgsql-committers@arkaria.postgresql.org; Mon, 18 Apr 2016 14:37:49 +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 1asAIy-0007d5-Om for pgsql-committers@postgresql.org; Mon, 18 Apr 2016 14:37:36 +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 1asAIv-0006YO-Ub for pgsql-committers@postgresql.org; Mon, 18 Apr 2016 14:37:36 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id C591720808 for ; Mon, 18 Apr 2016 10:37:31 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Mon, 18 Apr 2016 10:37:31 -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=U3zaABXcVn/Fs9GJpuNpYa3MXbo=; b=QAgrM CJgMpYfBNcRu9iv7+SfKrpWNmkn7gWVsjBJZD+/X82oAaEkaZC/9C55PeT5NyZu+ 2nRWnuD/2S8G5bXCR0Qg0AKAwJG+UMWtXdRjfdh2L0iW6jj5pyqBWJj1SGVuyo2w Pa+xTalzqLhoENc+OijKj51o+L5rcSvaC4C1mk= X-Sasl-enc: o7JOTgNzuQfflP8LWX7EAM2CkQqK4XKGO6nShjI/xxR0 1460990251 Received: from intern.anarazel.de (unknown [64.80.128.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 79C4D6801AC; Mon, 18 Apr 2016 10:37:31 -0400 (EDT) Date: Mon, 18 Apr 2016 07:37:25 -0700 From: Andres Freund To: Tom Lane Cc: pgsql-committers@postgresql.org Subject: Re: pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner. Message-ID: <20160418143725.cpgt544cwtjftxdr@alap3.anarazel.de> References: <9194.1460908908@sss.pgh.pa.us> <20160417170736.hbly4drjqdhnb5rm@alap3.anarazel.de> <11405.1460913629@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <11405.1460913629@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-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org On 2016-04-17 13:20:29 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2016-04-17 12:01:48 -0400, Tom Lane wrote: > >> Now that I've had some occasion to look around in bufmgr.c, I am very > >> unhappy that there are still boatloads of comments talking about a buffer > >> header's spinlock, when there is in fact no spinlock anymore. > > > That's actually intentional. Alexander had changed those, and it made > > the patch a good bit harder to read because there's so many references. > > As the new thing is still a spinlock, just not a s_lock.[ch] style on, I > > don't see changing all that to be a significant benefit. > > Well, I disagree: we consistently use "spinlock" to mean the s_lock.h > mechanism. Lock mechanisms are important, so using the same terminology > to refer to different implementations is not helpful. Especially when > it means you have no way to talk about one implementation as opposed > to the other. "s_lock.h" style spinlock vs. "BufferDesc type spinlock" etc. seems to work. Given where vertical scalability is going (more cores, more numa partitions (two in one socket now!), ...), it seems quite likely that we'll end up with further special case implementations. I don't think we'll be served well naming them differently if they have very similar rules to s_lock.h style spinlocks. > Imagine writing a comment that says "back when we used > to use spinlocks for this, we had to do FOO. Now that we use spinlocks, > we can do BAR instead." "Back when buffer locking used a s_lock.h style spinlock, ..., but now that it's just a flag in the BufferDesc's state, ...".. Doesn't seem like a problem. Greetings, Andres Freund -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers