Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aImdt-0002Y8-SK for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Jan 2016 00:16:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aImdt-0001qy-Ah for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Jan 2016 00:16:57 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aImds-0001qo-Py for pgsql-hackers@postgresql.org; Tue, 12 Jan 2016 00:16:56 +0000 Received: from out.smtp-auth.no-ip.com ([8.23.224.60]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aImdp-0008RB-KY for pgsql-hackers@postgresql.org; Tue, 12 Jan 2016 00:16:55 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [200.104.53.52]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id 6FC6D401CA1; Mon, 11 Jan 2016 16:16:45 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id F2D5A5D2; Mon, 11 Jan 2016 21:16:42 -0300 (CLT) Date: Mon, 11 Jan 2016 21:16:42 -0300 From: Alvaro Herrera To: Aleksander Alekseev Cc: Robert Haas , Teodor Sigaev , Andres Freund , "pgsql-hackers@postgresql.org" Subject: Re: Patch: fix lock contention for HASHHDR.mutex Message-ID: <20160112001642.GA802875@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20151230160137.034371e0@fujitsu> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.1 (-) 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 Andres, Robert, are you still reviewing this patch? Aleksander Alekseev wrote: > Here is a clean version of the patch. Step 1 is an optimization. Step 2 > refactors this: > > HTAB * > ShmemInitHash(const char *name, /* table string name for shmem index */ > - long init_size, /* initial table size */ > + long init_size, /* initial table size XXX ignored, > refactor! */ So you were saying some posts upthread that the new hash tables would "borrow" AN elements from the freelist then put AN elements back when too many got unused. Is that idea embodied in this patch? I'm nervous about continuing a line of development that does away with the "init_size" concept completely, but if this patch is keep the "borrow" concept then maybe it doesn't matter. > -/* Number of partitions of the shared buffer mapping hashtable */ > -#define NUM_BUFFER_PARTITIONS 128 > - > /* Number of partitions the shared lock tables are divided into */ > -#define LOG2_NUM_LOCK_PARTITIONS 4 > +#define LOG2_NUM_LOCK_PARTITIONS 7 > #define NUM_LOCK_PARTITIONS (1 << LOG2_NUM_LOCK_PARTITIONS) > > +/* Number of partitions of the shared buffer mapping hashtable */ > +#define NUM_BUFFER_PARTITIONS NUM_LOCK_PARTITIONS > + > /* Number of partitions the shared predicate lock tables are divided into */ > #define LOG2_NUM_PREDICATELOCK_PARTITIONS 4 > #define NUM_PREDICATELOCK_PARTITIONS (1 << LOG2_NUM_PREDICATELOCK_PARTITIONS) I find this odd. Why is it a good idea to define the bufMapping partitions like this? What's the explanation for the performance numbers you saw? -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers