Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id B2A401337C2C for ; Mon, 11 Apr 2011 15:00:45 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 31627-04 for ; Mon, 11 Apr 2011 18:00:35 +0000 (UTC) Received: from mx2.hub.org (mx2.hub.org [200.46.204.254]) by mail.postgresql.org (Postfix) with ESMTP id F2E461337B67 for ; Mon, 11 Apr 2011 15:00:12 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og106.obsmtp.com (exprod7og106.obsmtp.com [64.18.2.165]) by mx2.hub.org (Postfix) with ESMTP id 14FD83EAED1B for ; Mon, 11 Apr 2011 11:58:09 -0300 (ADT) Received: from mail-ew0-f52.google.com ([209.85.215.52]) (using TLSv1) by exprod7ob106.postini.com ([64.18.6.12]) with SMTP ID DSNKTaMWpAmvmAMuvU15ZWYCz/T5uXE3PU/A@postini.com; Mon, 11 Apr 2011 07:58:11 PDT Received: by mail-ew0-f52.google.com with SMTP id 28so2145776ewy.39 for ; Mon, 11 Apr 2011 07:56:36 -0700 (PDT) Received: by 10.213.109.193 with SMTP id k1mr2062682ebp.109.1302519523769; Mon, 11 Apr 2011 03:58:43 -0700 (PDT) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id x54sm3652313eeh.5.2011.04.11.03.58.41 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Apr 2011 03:58:42 -0700 (PDT) Message-ID: <4DA2DEE0.50801@enterprisedb.com> Date: Mon, 11 Apr 2011 13:58:40 +0300 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.16) Gecko/20110307 Icedove/3.0.11 MIME-Version: 1.0 To: Kevin Grittner CC: Dan Ports , YAMAMOTO Takashi , pgsql-hackers@postgresql.org Subject: Re: SSI bug? References: <4D8F54E6020000250003BD16@gw.wicourts.gov> <4D8F54E6020000250003BD16@gw.wicourts.gov> <20110328031616.CDAA719CEDF@mail.netbsd.org> <4D943BEC020000250003BFDA@gw.wicourts.gov> <4D94A2BB.3090605@enterprisedb.com> <4D946036020000250003BFFC@gw.wicourts.gov> <20110331181216.GF81592@csail.mit.edu> <4D948066020000250003C00B@gw.wicourts.gov> <4D94C889.3050607@enterprisedb.com> <4D948A7D020000250003C012@gw.wicourts.gov> <4DA2BCC2.7080903@enterprisedb.com> In-Reply-To: <4DA2BCC2.7080903@enterprisedb.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201104/629 X-Sequence-Number: 185831 On 11.04.2011 11:33, Heikki Linnakangas wrote: > On 31.03.2011 22:06, Kevin Grittner wrote: >> Heikki Linnakangas wrote: >> >>> That's not enough. The hash tables can grow beyond the maximum >>> size you specify in ShmemInitHash. It's just a hint to size the >>> directory within the hash table. >>> >>> We'll need to teach dynahash not to allocate any more entries >>> after the preallocation. A new HASH_NO_GROW flag to hash_create() >>> seems like a suitable interface. >> >> OK. If we're doing that, is it worth taking a look at the "safety >> margin" added to the size calculations, and try to make the >> calculations more accurate? >> >> Would you like me to code a patch for this? > > I finally got around to look at this. Attached patch adds a > HASH_FIXED_SIZE flag, which disables the allocation of new entries after > the initial allocation. I believe we have consensus to make the > predicate lock hash tables fixed-size, so that there's no competition of > the slack shmem space between predicate lock structures and the regular > lock maanager. Ok, committed that. I left the safety margins in the size calculations alone for now. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com