Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1apa4M-0003tN-AG for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Apr 2016 11:31: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 1apa4L-0007tp-SN for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Apr 2016 11:31: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 1apa4L-0007sl-45 for pgsql-hackers@postgresql.org; Mon, 11 Apr 2016 11:31:49 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1apa4E-0002oc-Bi for pgsql-hackers@postgresql.org; Mon, 11 Apr 2016 11:31:48 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 8DF7A20BCE for ; Mon, 11 Apr 2016 07:31:39 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Mon, 11 Apr 2016 07:31:39 -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=aP8v7CHVyOOoK97RhRw+6RBm7VY=; b=jDFDz fBjBE4rgB0IzbWQGxFnwGr8wNRn2KKfOHFReWqLUkPAys119tUtzHOdnmZGou8P1 2KuJBQtb3H7TjEkvkf/Tia2/Y5X1It9Qk++Lc2vKo2lWhMCPNKpmb2l2O8unGTrw EPy3sbBvUwsf70IPkurxmeG+rJ5LpUlx0iuTyU= X-Sasl-enc: tzR3F+NEQhEXZyQMSRrHaJNWsvZvrZe6TSpoagYAoC6I 1460374299 Received: from intern.anarazel.de (unknown [192.77.237.104]) by mail.messagingengine.com (Postfix) with ESMTPA id 30447680196; Mon, 11 Apr 2016 07:31:39 -0400 (EDT) Date: Mon, 11 Apr 2016 04:31:38 -0700 From: Andres Freund To: Robert Haas Cc: Tom Lane , "pgsql-hackers@postgresql.org" Subject: Re: [COMMITTERS] pgsql: Move each SLRU's lwlocks to a separate tranche. Message-ID: <20160411113138.amwskmlzi4wwhy2f@alap3.anarazel.de> References: <20160325070506.56i5p7jzxwqfljm6@alap3.anarazel.de> <31588.1458913723@sss.pgh.pa.us> <14166.1458924422@sss.pgh.pa.us> <20160410230856.xont3ukgmsnpygrf@alap3.anarazel.de> <20160411040101.ll2ouzvjy7xawzfo@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Hi, On 2016-04-11 07:09:18 -0400, Robert Haas wrote: > Attached patch does that. Thanks. > > Additionally, doesn't this obsolete > > > > /* > > * Preferred alignment for disk I/O buffers. On some CPUs, copies between > > * user space and kernel space are significantly faster if the user buffer > > * is aligned on a larger-than-MAXALIGN boundary. Ideally this should be > > * a platform-dependent value, but for now we just hard-wire it. > > */ > > #define ALIGNOF_BUFFER 32 > > I didn't go as far as trying to remove this; a few other random things > are using it. All of the places using it look like they actually rather should use CACHELINEALIGN... > diff --git a/src/backend/storage/ipc/shmem.c b/src/backend/storage/ipc/shmem.c > index 1ad68cd..8e6cbdb 100644 > --- a/src/backend/storage/ipc/shmem.c > +++ b/src/backend/storage/ipc/shmem.c > @@ -112,6 +112,7 @@ void > InitShmemAllocation(void) > { > PGShmemHeader *shmhdr = ShmemSegHdr; > + char *aligned; > > Assert(shmhdr != NULL); > > @@ -139,6 +140,11 @@ InitShmemAllocation(void) > shmhdr->freeoffset += MAXALIGN(sizeof(slock_t)); > Assert(shmhdr->freeoffset <= shmhdr->totalsize); > > + /* Make sure the first allocation begins on a cache line boundary. */ > + aligned = (char *) > + (CACHELINEALIGN((((char *) shmhdr) + shmhdr->freeoffset))); > + shmhdr->freeoffset = aligned - (char *) shmhdr; > + > SpinLockInit(ShmemLock); In the patch attached to http://www.postgresql.org/message-id/20160411051004.yvniqb2pkc7re5k7@alap3.anarazel.de I did this instead by fixing up the actual shared memory allocation, which seems a tiny bit cleaner. But the asserts added there seem like a worthwhile addition to me. 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