Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X1gK6-0006PI-Fe for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Jun 2014 18:29:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X1gK5-0005tT-OO for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Jun 2014 18:29:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X1gK4-0005tG-2U for pgsql-hackers@postgresql.org; Mon, 30 Jun 2014 18:29:00 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X1gK0-0006gE-Ha for pgsql-hackers@postgresql.org; Mon, 30 Jun 2014 18:28:58 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id ACAD6500001; Mon, 30 Jun 2014 20:28:55 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-5.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from anarazel.de (p54AF441C.dip0.t-ipconnect.de [84.175.68.28]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id A4D3C4F0001; Mon, 30 Jun 2014 20:28:52 +0200 (CEST) Received: by anarazel.de (Postfix, from userid 1000) id 3BD9D100041; Mon, 30 Jun 2014 20:28:52 +0200 (CEST) Date: Mon, 30 Jun 2014 20:28:52 +0200 From: Andres Freund To: Robert Haas Cc: Tom Lane , Peter Geoghegan , Pg Hackers , Ants Aasma Subject: Re: better atomics - v0.5 Message-ID: <20140630182852.GS26930@awork2.anarazel.de> References: <54412.1403808435@sss.pgh.pa.us> <20140626190405.GA21422@awork2.anarazel.de> <20140627180033.GF18288@awork2.anarazel.de> <20140628082559.GB6450@awork2.anarazel.de> <11914.1404147250@sss.pgh.pa.us> <20140630174447.GL21422@awork2.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140630174447.GL21422@awork2.anarazel.de> 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 2014-06-30 19:44:47 +0200, Andres Freund wrote: > On 2014-06-30 13:15:23 -0400, Robert Haas wrote: > > People who write code that uses atomics are not > > likely to think about how those algorithms will actually perform when > > those atomics are merely emulated, and I suspect that means that in > > practice platforms that have only emulated atomics are going to > > regress significantly vs. the status quo today. > > I think you're overstating the likely performance penalty for > nonparallel platforms/workloads here quite a bit. The platforms without > changes of gettings atomics implemented aren't ones where that's a > likely thing. Yes, you'll see a regression if you run a readonly pgbench > over a 4 node NUMA system - but it's not large. You won't see much of > improved performance in comparison to 9.4, but I think that's primarily > it. To quantify this, on my 2 socket xeon E5520 workstation - which is too small to heavily show the contention problems in pgbench -S - the numbers are: pgbench -M prepared -c 16 -j 16 -T 10 -S (best of 5, noticeably variability) master: 152354.294117 lwlocks-atomics: 170528.784958 lwlocks-atomics-spin: 159416.202578 pgbench -M prepared -c 1 -j 1 -T 10 -S (best of 5, noticeably variability) master: 16273.702191 lwlocks-atomics: 16768.712433 lwlocks-atomics-spin: 16744.913083 So, there really isn't a problem with the emulation. It's not actually that surprising - the absolute number of atomic ops is prety much the same. Where we earlier took a spinlock to increment shared we now still take one. I expect that repeating this on the 4 socket machine will show a large gap between lwlocks-atomics and the other two. The other two will be about the same, with lwlocks-atomics-spin remaining a bit better than master. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers