Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a9vOI-0003HY-BF for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Dec 2015 13:48:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a9vOH-0007AF-OX for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Dec 2015 13:48:13 +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 1a9vMy-0005dI-8Q for pgsql-hackers@postgresql.org; Fri, 18 Dec 2015 13:46:52 +0000 Received: from hook.sigaev.ru ([93.180.27.50]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a9vMq-0007cG-Gt for pgsql-hackers@postgresql.org; Fri, 18 Dec 2015 13:46:50 +0000 Received: from xor.sai.msu.ru (newmail.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: teodor) by hook.sigaev.ru (Postfix) with ESMTPSA id BDA49B1918A; Fri, 18 Dec 2015 16:46:41 +0300 (MSK) Subject: Re: Patch: fix lock contention for HASHHDR.mutex To: Robert Haas , Aleksander Alekseev Cc: Andres Freund , "pgsql-hackers@postgresql.org" References: <20151211170001.78ded9d7@fujitsu> <20151215122513.GC17724@alap3.anarazel.de> <20151217151418.GB2224@awork2.anarazel.de> <20151217190342.07e4533a@fujitsu> From: Teodor Sigaev Message-ID: <56740E41.4010708@sigaev.ru> Date: Fri, 18 Dec 2015 16:46:41 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) 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 > Oh, that's an interesting idea. I guess the problem is that if the > freelist is unshared, then users might get an error that the lock > table is full when some other partition still has elements remaining. Could we split one freelist in hash to NUM_LOCK_PARTITIONS freelists? Each partition will have its own freelist and if freelist is empty then partition should search an entry in freelists of other partitions. To prevent concurrent access it's needed to add one LWLock to hash, each partition should lock LWlock in share mode to work with its own freelist and exclusive to work with other freelists. Actually, I'd like to improve all partitioned hashes instead of improve only one case. -- Teodor Sigaev E-mail: teodor@sigaev.ru WWW: http://www.sigaev.ru/ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers