Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ajSSs-0007om-06 for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Mar 2016 14:11: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 1ajSSr-0004NC-6y for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Mar 2016 14:11: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 1ajSSp-0004N3-8W for pgsql-hackers@postgresql.org; Fri, 25 Mar 2016 14:11:47 +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 1ajSSk-0002r5-4C for pgsql-hackers@postgresql.org; Fri, 25 Mar 2016 14:11:44 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id D6D6D20ABC for ; Fri, 25 Mar 2016 10:11:40 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Fri, 25 Mar 2016 10:11:40 -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=jrw3WH923Dv+dc7 11kEq5gusOSM=; b=u3co4BJwEUtG2tTArtHORUeXZbjcXY9lDqBryGuTL6qPjDy XB+obK3MKaqi+BbW8oC7Jw2UGojSmrhE3JIDE8HjSMSxxgGrv1YebU1X4oDKejWZ 94nOlLIfas9Cqo8Q3EWERhtJuEbk+7/BFOn50jh3blmr8Eu0HDGn2bGviqZM= X-Sasl-enc: eBSa2vPSZmJ8jACC7JR8cXR39vyyAqqCr5h68nKr4Uz7 1458915100 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 2CC0AC00018; Fri, 25 Mar 2016 10:11:40 -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 15:11:38 +0100 To: Robert Haas CC: "pgsql-hackers@postgresql.org" Message-ID: <618335ED-9690-4C95-8915-B79C00C90AA4@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 March 25, 2016 2:48:00 PM GMT+01:00, Robert Haas wrote: >On Fri, Mar 25, 2016 at 9:11 AM, Andres Freund >wrote: >> 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. > >Gosh, I thought *I* had last proposed that and *you* had shot it down. > >Why ever would we not want to do that? See Tom's response. The reason I didn't do it last time is that we previously had that argument. I think that's just a waste of or time. It's ridiculously hard figuring it alignment issues, I spent days on the buffer desc thing. -- 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