Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqLew-0001Re-Qg for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Apr 2016 14:20: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 1aqLew-0003xp-Cw for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Apr 2016 14:20:46 +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 1aqLeu-0003s8-HC for pgsql-hackers@postgresql.org; Wed, 13 Apr 2016 14:20:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aqLes-00050D-1E; Wed, 13 Apr 2016 14:20:43 +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 u3DEKbt1021699; Wed, 13 Apr 2016 10:20:37 -0400 From: Tom Lane To: Robert Haas cc: Andres Freund , Alvaro Herrera , Noah Misch , Kevin Grittner , Kevin Grittner , "pgsql-hackers@postgresql.org" Subject: Re: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold < In-reply-to: References: <20160412185625.g7ixnlpwaqvsqt7v@alap3.anarazel.de> <20160413025214.GA954515@alvherre.pgsql> <20160413030530.dfldqhmtojo222c4@alap3.anarazel.de> <20591.1460555524@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Wed, 13 Apr 2016 10:11:06 -0400" Date: Wed, 13 Apr 2016 10:20:37 -0400 Message-ID: <21698.1460557237@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-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Robert Haas writes: > On Wed, Apr 13, 2016 at 9:52 AM, Tom Lane wrote: >> Robert Haas writes: >>> I have never understood why you didn't include 64-bit atomics in the >>> original atomics implementation, and I really think we should have >>> committed a patch to add them long before now. >> What will you do on 32-bit platforms (or, more generally, anything >> lacking 64-bit-wide atomics)? > We fall back to emulating it using spinlocks. That's what I thought you were going to say, and it means that any "performance improvement" patch that relies on 64-bit atomics in hotspot code paths is going to be a complete disaster on anything but modern Intel hardware. I'm not sure that's a direction we want to go in. We need to stick to a set of atomics that's pretty widely portable. > This isn't really an > issue in practice because 32-bit x86 has native 64-bit atomics, and > it's hard to point to another 32-bit platform that is likely to be > have enough concurrency for the lack of 64-bit atomics to matter. It's not concurrency I'm worried about, it's the sheer overhead of going through the spinlock code. I'd be okay with atomics that were defined as "pointer width", if we have a need for that, but I'm suspicious of 64-bits-exactly. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers