Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1apT2D-0003dc-En for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Apr 2016 04:01:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1apT2D-0006IX-1E for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Apr 2016 04:01:09 +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 1apT2C-0006IR-Js for pgsql-hackers@postgresql.org; Mon, 11 Apr 2016 04:01:08 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1apT29-0001dn-79 for pgsql-hackers@postgresql.org; Mon, 11 Apr 2016 04:01:08 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 50E0920763 for ; Mon, 11 Apr 2016 00:01:03 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Mon, 11 Apr 2016 00:01:03 -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=U0sERHqeZUygj4wL1twkFaoPjhc=; b=n68P8 C7wl3+gByI0YQXThheCRuYFTFZAM2vny1yjuY/IP6Iug58Youak3VltlNNpceqWx INsHNhkzqiXER1sSvlBK8vfJFfwZyV3/4k7u01QxDK1/UYvZiqD+Pos5Rm/NEukX oATWXBmX4JAu2mZg3emzrnwmo7kLz63NvZHu08= X-Sasl-enc: zOqcdj3gEwad+qhvMoHAvSO3f5n9qiUED5alBLWw8k4O 1460347263 Received: from intern.anarazel.de (unknown [192.77.237.104]) by mail.messagingengine.com (Postfix) with ESMTPA id 0CB74C0001A; Mon, 11 Apr 2016 00:01:03 -0400 (EDT) Date: Sun, 10 Apr 2016 21:01:01 -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: <20160411040101.ll2ouzvjy7xawzfo@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160410230856.xont3ukgmsnpygrf@alap3.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 2016-04-10 16:08:56 -0700, Andres Freund wrote: > On 2016-04-05 15:48:22 -0400, Robert Haas wrote: > > On Fri, Mar 25, 2016 at 12:47 PM, Tom Lane wrote: > > > Robert Haas writes: > > >> On Fri, Mar 25, 2016 at 9:48 AM, Tom Lane wrote: > > >>> Robert Haas writes: > > >>>> 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. > > > > > >>> I think such a proposal should come with a measurement, not just > > >>> speculation about what it costs. > > > > > >> About 6kB with default settings. See below. > > > > > > Sold, then. > > > > Excellent. Done. > > InitBufferPool() manually fixes up alignment; that should probably be > removed now. > > I also wonder if it doesn't make sense to fix PG_CACHE_LINE_SIZE to > 64byte on x86. I personally think a manual ifdef in pg_config_manual.h > is ok for that. Also, this doesn't seem to be complete. This now aligns sizes to cacheline boundaries, but it doesn't actually align the returned values afaics? That might kind of work sometimes, if freeoffset is initially aligned to PG_CACHE_LINE_SIZE, but that's not guaranteed, it's just shmhdr->freeoffset += MAXALIGN(sizeof(slock_t)); 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 and /* extra alignment for large requests, since they are probably buffers */ if (size >= BLCKSZ) newStart = BUFFERALIGN(newStart); - Andres -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers