Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1abOZ2-0006I7-0e for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Mar 2016 08:24:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1abOZ1-0001Ck-Ja for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Mar 2016 08:24:51 +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) (envelope-from ) id 1abOXg-00088X-7i for pgsql-hackers@postgresql.org; Thu, 03 Mar 2016 08:23:28 +0000 Received: from newmail.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1abOXd-0005Ai-7w for pgsql-hackers@postgresql.org; Thu, 03 Mar 2016 08:23:27 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 2467B21C687B; Thu, 3 Mar 2016 11:23:24 +0300 (MSK) Received: from mail.postgrespro.ru ([127.0.0.1]) by localhost (mail.postgrespro.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jGsWYieQLSa8; Thu, 3 Mar 2016 11:23:22 +0300 (MSK) Received: from fujitsu (unknown [192.168.27.1]) by mail.postgrespro.ru (Postfix) with ESMTPSA id 2F47F21C6835; Thu, 3 Mar 2016 11:23:22 +0300 (MSK) Date: Thu, 3 Mar 2016 11:20:43 +0300 From: Aleksander Alekseev To: Amit Kapila Cc: Robert Haas , pgsql-hackers , Anastasia Lubennikova Subject: Re: Patch: fix lock contention for HASHHDR.mutex Message-ID: <20160303112043.7d53782e@fujitsu> In-Reply-To: References: <20160208192857.GA316589@alvherre.pgsql> <20160210112400.22c0b677@fujitsu> <20160211171101.33f34160@fujitsu> <20160212183445.716b2845@fujitsu> <20160301174313.218e04c7@fujitsu> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 > Won't it always use the same freelist to remove and add the entry from > freelist as for both cases it will calculate the freelist_idx in same > way? No. If "our" freelist is empty when we try to remove an item from it we borrow item from another freelist. Then this borrowed item will be returned to "our" freelist instead of original. Without some sort of additional logic there is no way to figure out what freelist was original. Generally speaking negative nentries value is not something that couldn't be solved. But I would like to remind that in this context we are discussing a quick and dirty solution created for benchmark purposes in a first place. > You are not convinced, then lets leave it to committer unless > somebody else wants to try that suggestion. Agree. Frankly I'm tired of rewriting this patch over and over and over again. So I would like to avoid rewriting it once again unless there is a clear indication that this way we would gain something. Benchmarks shows that this is not a case thus it's only a matter of taste and intuition. We know from experience that both are bad advisers in optimization matter. I suggest we merge this patch already: http://www.postgresql.org/message-id/CA+Tgmobtf9nH566_jjs=jrTyMq5HdQdaRF5j7o+AbdOWQHE_Ow@mail.gmail.com ... and get done with it. Clearly this patch is good enough --- reviewed, tested, discussed, has proven performance extremum. When and if dynahash will become a bottleneck again nothing will stop us from optimizing it one more time for hardware we will have by then. Who knows what this hardware will be like in 5-10 years? Don't we have better things to do now than arguing about imaginary benchmarks and taste? Lets see what is committer's opinion on this. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers