Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1app9D-0007hT-Bp for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Apr 2016 03:37:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1app9C-0004ae-UZ for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Apr 2016 03:37:50 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1app7s-00036f-6T for pgsql-hackers@postgreSQL.org; Tue, 12 Apr 2016 03:36:28 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1app7p-0003ZH-MI for pgsql-hackers@postgreSQL.org; Tue, 12 Apr 2016 03:36:27 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B001721866 for ; Mon, 11 Apr 2016 23:36:24 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Mon, 11 Apr 2016 23:36:24 -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=MxDgsxTPdS78fCcZXCwm6KnZMEk=; b=UJ/Jo ihvwHt14RNXA9rdEu3Fq7R8xSjs9I6JhUSlhluxEOR3CA66n5yPnmYEr6wqYbt5V qtwAkggDXGI6kxCSr4ri5x94mf9C1HrUbi/Irwf7Sho4dobBW05fRJ7xAK0niOGH p+haWvQKsvzYDkS4AbY7idpMJRkAFGFoy0SXM8= X-Sasl-enc: EQSZkC+kvOsQHXtkjIqGZRqHrb3vj/YONCeaJH7qtjqr 1460432180 Received: from intern.anarazel.de (unknown [184.23.178.130]) by mail.messagingengine.com (Postfix) with ESMTPA id 7639A680290; Mon, 11 Apr 2016 23:36:20 -0400 (EDT) Date: Mon, 11 Apr 2016 20:36:18 -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: <20160412033618.c56ksvf3me4mpwii@alap3.anarazel.de> References: <1881.1460431476@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1881.1460431476@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-11 23:24:36 -0400, Tom Lane wrote: > Andres Freund writes: > > Allow Pin/UnpinBuffer to operate in a lockfree manner. > > This commit has broken buildfarm member gaur, and no doubt pademelon > will be equally unhappy once it catches up to HEAD. The reason is that > you've caused localbuf.c to perform a whole bunch of atomic operations > on its buffer headers; and on machines that don't have native atomic > ops, there's a spinlock underlying those; and you did not bother to > ensure that appropriate SpinLockInit operations happen for local-buffer > headers. (HPPA, possibly alone among supported platforms, does not > think that SpinLockInit is equivalent to memset-to-zeroes.) That's obviously borked, and need to be fixed. > While we could fix this by performing suitable SpinLockInit's on > local-buffer headers, I have to think that that's fundamentally the > wrong direction. The *entire* *point* of having local buffers is > that they are not subject to concurrency overhead. So IMO, sticking > atomic-ops calls into localbuf.c is broken on its face. Note that localbuf.c tries to be careful to only use pg_atomic_read_u32/pg_atomic_write_u32 - which don't have a concurrency overhead as they don't utilize atomic ops. The issue is likely that either Alexander or I somehow made MarkLocalBufferDirty() use pg_atomic_fetch_or_u32(), instead of the proper pg_atomic_read_u32()/pg_atomic_write_u32(). 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