Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1asAdg-0001Rx-4z for pgsql-committers@arkaria.postgresql.org; Mon, 18 Apr 2016 14:59:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1asAdf-0003bE-GL for pgsql-committers@arkaria.postgresql.org; Mon, 18 Apr 2016 14:58:59 +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 1asAdS-0003NM-RY for pgsql-committers@postgresql.org; Mon, 18 Apr 2016 14:58:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1asAdP-00071f-RS for pgsql-committers@postgresql.org; Mon, 18 Apr 2016 14:58:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u3IEwZAc024613; Mon, 18 Apr 2016 10:58:35 -0400 From: Tom Lane To: Robert Haas cc: Andres Freund , Alexander Korotkov , pgsql-committers Subject: Re: pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner. In-reply-to: References: <9194.1460908908@sss.pgh.pa.us> <20160418142750.p3qwwnnuacb6n7jw@alap3.anarazel.de> Comments: In-reply-to Robert Haas message dated "Mon, 18 Apr 2016 10:48:24 -0400" Date: Mon, 18 Apr 2016 10:58:35 -0400 Message-ID: <24612.1460991515@sss.pgh.pa.us> X-Pg-Spam-Score: -2.9 (--) 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 Robert Haas writes: > On Mon, Apr 18, 2016 at 10:27 AM, Andres Freund wrote: >> Personally I think the "spin" part is actually quite relevant, and I >> think we shouldn't loose it. It describes concurrency and blocking >> behaviour, and how errors need to be handled (i.e. there may not be >> any). > IMHO, "buffer header lock bit" is plenty clear enough. We could say > "buffer header spin lock bit" but I think that's too many words and > not actually more clear. I agree. If it's just a bit, it pretty much has to be a spin lock, because there's no way for it to contain any infrastructure that would support anything else. In any case, you could and should document the exact semantics in a comment associated with the declaration of that bit field. It's not really necessary to repeat them in every reference, so long as the references use a unique name that won't be confused with other possible locking mechanisms. (From that standpoint, "header lock bit" might be actively better than anything including the phrase "spin lock", since it reduces the chance of confusion with s_lock.h.) regards, tom lane -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers