Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UNYFV-0006sh-05 for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Apr 2013 00:41:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UNYFU-0007w0-DA for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Apr 2013 00:41:52 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UNYFT-0007v9-9R for pgsql-hackers@postgresql.org; Thu, 04 Apr 2013 00:41:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UNYFN-000353-CD for pgsql-hackers@postgresql.org; Thu, 04 Apr 2013 00:41:50 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r340fdcr029210; Wed, 3 Apr 2013 20:41:39 -0400 (EDT) From: Tom Lane To: Greg Stark cc: Robert Haas , Andres Freund , Merlin Moncure , Jim Nasby , Jeff Janes , Ants Aasma , Atri Sharma , Amit Kapila , PostgreSQL-development Subject: Re: Page replacement algorithm in buffer cache In-reply-to: References: <3949.1364921816@sss.pgh.pa.us> <20130402172041.GH2415@alap2.anarazel.de> Comments: In-reply-to Greg Stark message dated "Thu, 04 Apr 2013 00:48:45 +0100" Date: Wed, 03 Apr 2013 20:41:39 -0400 Message-ID: <29209.1365036099@sss.pgh.pa.us> X-Pg-Spam-Score: -4.2 (----) 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 Greg Stark writes: > I'm still skeptical about the idea of a "freelist". That just seems like a > terrible point of contention. However perhaps that's because I'm picturing > an LRU linked list. Perhaps the right thing is to maintain a pool of > buffers in some less contention-prone data structure which lets each > backend pick buffers out more or less independently of the others. I think the original vision of the clock sweep algorithm included the idea that different backends could be running the sweep over different parts of the buffer ring concurrently. If we could get rid of the need to serialize that activity, it'd pretty much eliminate the bottleneck I should think. The problem is how to manage it to ensure that (a) backends aren't actually contending on the same buffers as they do this, and (b) there's a reasonably fair rate of usage_count decrements for each buffer, rather than possibly everybody ganging up on the same area sometimes. Thoughts? regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers