pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [COMMITTERS] pgsql: Move each SLRU's lwlocks to a separate tranche.
Date: Fri, 25 Mar 2016 15:11:38 +0100
Message-ID: <618335ED-9690-4C95-8915-B79C00C90AA4@anarazel.de> (raw)
In-Reply-To: <CA+TgmobFiNkAvGQzpN_O1nK=zuvAvgQFYFBjyXjP3XsOHmP7yg@mail.gmail.com>
References: <E1Zwy2E-0003Rt-1O@gemulon.postgresql.org>
	<20160325070506.56i5p7jzxwqfljm6@alap3.anarazel.de>
	<CA+TgmoZ4PsKukByQbpADpshmhWY99C-fM_Pk5RE2_ahXTn8BNA@mail.gmail.com>
	<B3C64401-DF02-42F4-918F-8EB7F5BFE5C3@anarazel.de>
	<CA+TgmobFiNkAvGQzpN_O1nK=zuvAvgQFYFBjyXjP3XsOHmP7yg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>



On March 25, 2016 2:48:00 PM GMT+01:00, Robert Haas <robertmhaas@gmail.com> wrote:
>On Fri, Mar 25, 2016 at 9:11 AM, Andres Freund <andres@anarazel.de>
>wrote:
>> On March 25, 2016 1:04:13 PM GMT+01:00, Robert Haas
><robertmhaas@gmail.com> wrote:
>>>On Fri, Mar 25, 2016 at 3:05 AM, Andres Freund <andres@anarazel.de>
>>>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



view thread (15+ messages)  latest in thread

Message-ID: <618335ED-9690-4C95-8915-B79C00C90AA4@anarazel.de>
Permalink:  ../618335ED-9690-4C95-8915-B79C00C90AA4@anarazel.de/
Also on:    postgresql.org/message-id/618335ED-9690-4C95-8915-B79C00C90AA4@anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de, robertmhaas@gmail.com, pgsql-hackers@postgresql.org
  Subject: Re: [COMMITTERS] pgsql: Move each SLRU's lwlocks to a separate tranche.
  In-Reply-To: <618335ED-9690-4C95-8915-B79C00C90AA4@anarazel.de>
  References: <E1Zwy2E-0003Rt-1O@gemulon.postgresql.org> <20160325070506.56i5p7jzxwqfljm6@alap3.anarazel.de> <CA+TgmoZ4PsKukByQbpADpshmhWY99C-fM_Pk5RE2_ahXTn8BNA@mail.gmail.com> <B3C64401-DF02-42F4-918F-8EB7F5BFE5C3@anarazel.de> <CA+TgmobFiNkAvGQzpN_O1nK=zuvAvgQFYFBjyXjP3XsOHmP7yg@mail.gmail.com> <618335ED-9690-4C95-8915-B79C00C90AA4@anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox