Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ajRX4-0005LP-0B for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Mar 2016 13:12:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ajRX3-0004v4-FJ for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Mar 2016 13:12:05 +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 1ajRX1-0004qS-L2 for pgsql-hackers@postgresql.org; Fri, 25 Mar 2016 13:12:03 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ajRWy-0001ck-Rd for pgsql-hackers@postgresql.org; Fri, 25 Mar 2016 13:12:03 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C86132051A for ; Fri, 25 Mar 2016 09:11:57 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Fri, 25 Mar 2016 09:11:57 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=EfBXdc40Pi+Hc7d ItGs+1D1HXnI=; b=uzAfxGZrzSlp5usQaEdCKPXRlwzCl5kftKz4kcr+83257EY paRx9bR0OX+BP+MkCk/XKNcIyZf+rBrzuLOnvfOHFhOra5Y4/kx9ULZ6Bj0jeq+t x05nZuMCy8WLK/vcjeieTii/EqzKtD+opyxFuVRhkRGltrKiVI28G0jzFwqI= X-Sasl-enc: WsLQyQx6IIFx1oEGGNd4WynxD0GSoN/ouzWZ9TfA27fH 1458911517 Received: from [10.22.35.163] (tmo-115-107.customers.d1-online.com [80.187.115.107]) by mail.messagingengine.com (Postfix) with ESMTPA id E8C0DC00014; Fri, 25 Mar 2016 09:11:56 -0400 (EDT) User-Agent: K-9 Mail for Android In-Reply-To: References: <20160325070506.56i5p7jzxwqfljm6@alap3.anarazel.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: [COMMITTERS] pgsql: Move each SLRU's lwlocks to a separate tranche. From: Andres Freund Date: Fri, 25 Mar 2016 14:11:55 +0100 To: Robert Haas CC: pgsql-committers ,"pgsql-hackers@postgresql.org" Message-ID: 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 March 25, 2016 1:04:13 PM GMT+01:00, Robert Haas wrote: >On Fri, Mar 25, 2016 at 3:05 AM, Andres Freund >wrote: >> On 2015-11-12 19:59:54 +0000, Robert Haas wrote: >>> Move each SLRU's lwlocks to a separate tranche. >>> >>> This makes it significantly easier to identify these lwlocks in >>> LWLOCK_STATS or Trace_lwlocks output. It's also arguably better >>> from a modularity standpoint, since lwlock.c no longer needs to >>> know anything about the LWLock needs of the higher-level SLRU >>> facility. >>> >>> Ildus Kurbangaliev, reviewd by Álvaro Herrera and by me. >> >> Before this commit the lwlocks were cacheline aligned, but that's not >> the case anymore afterwards; afaics. I think that should be fixed? I >> guess it'd be good to avoid duplicating the code for aligning, so >maybe >> we ought to add a ShmemAllocAligned or something? > >Does it actually matter? I wouldn't have thought the I/O locks had >enough traffic for it to make any difference. > >But in any case I think the right solution is probably this: > >--- a/src/backend/storage/ipc/shmem.c >+++ b/src/backend/storage/ipc/shmem.c >@@ -173,7 +173,7 @@ ShmemAlloc(Size size) > /* > * ensure all space is adequately aligned. > */ >- size = MAXALIGN(size); >+ size = CACHELINEALIGN(size); > > Assert(ShmemSegHdr != NULL); > >It's stupid that we keep spending time and energy figuring out which >shared memory data structures require alignment and which ones don't. >Let's just align them *all* and be done with it. The memory cost >shouldn't be more than a few kB. Last time I proposed that it got shut down. I agree it'd be a good idea, it's really hard to find alignment issues. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers