Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UflvT-0007RO-NP for pgsql-hackers@arkaria.postgresql.org; Fri, 24 May 2013 06:56:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UflvR-0007WS-Pc for pgsql-hackers@arkaria.postgresql.org; Fri, 24 May 2013 06:56:29 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UflvP-0007WK-DQ for pgsql-hackers@postgreSQL.org; Fri, 24 May 2013 06:56:27 +0000 Received: from szxga02-in.huawei.com ([119.145.14.65]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UflvJ-00081T-A4 for pgsql-hackers@postgreSQL.org; Fri, 24 May 2013 06:56:26 +0000 Received: from 172.24.2.119 (EHLO szxeml206-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id BCB36347; Fri, 24 May 2013 14:56:08 +0800 (CST) Received: from SZXEML405-HUB.china.huawei.com (10.82.67.60) by szxeml206-edg.china.huawei.com (172.24.2.59) with Microsoft SMTP Server (TLS) id 14.1.323.7; Fri, 24 May 2013 14:55:18 +0800 Received: from blrprnc09ns (10.18.96.98) by szxeml405-hub.china.huawei.com (10.82.67.60) with Microsoft SMTP Server id 14.1.323.7; Fri, 24 May 2013 14:55:30 +0800 From: Amit Kapila To: "'Jim Nasby'" , "'Greg Smith'" CC: "'PostgreSQL-development'" References: <002f01ce50a8$e057c7a0$a10756e0$@kapila@huawei.com> <51928CDA.7030009@2ndQuadrant.com> <519E873D.5000406@nasby.net> In-Reply-To: <519E873D.5000406@nasby.net> Subject: Re: Move unused buffers to freelist Date: Fri, 24 May 2013 12:25:29 +0530 Message-ID: <006001ce584b$adfc55f0$09f501d0$@kapila@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac5X+txQpahO2w5ERLGGnHfWVGOrsAAUHYRQ Content-Language: en-us X-Originating-IP: [10.18.96.98] X-CFilter-Loop: Reflected X-Pg-Spam-Score: 0.7 (/) 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 On Friday, May 24, 2013 2:47 AM Jim Nasby wrote: > On 5/14/13 2:13 PM, Greg Smith wrote: > > It is possible that we are told to put something in the freelist that > > is already in it; don't screw up the list if so. > > > > I don't see where the code does anything to handle that though. What > was your intention here? > > IIRC, the code that pulls from the freelist already deals with the > possibility that a block was on the freelist but has since been put to > use. You are right, the check exists in StrategyGetBuffer() >If that's the case then there shouldn't be much penalty to adding > a block multiple times (at least within reason...) There is a check in StrategyFreeBuffer() which will not allow to put multiple times, I had just used the same check in new function. With Regards, Amit Kapila. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers