pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <amit.kapila@huawei.com>
To: 'Jim Nasby' <jim@nasby.net>
To: 'Greg Smith' <greg@2ndQuadrant.com>
Cc: 'PostgreSQL-development' <pgsql-hackers@postgreSQL.org>
Subject: Re: Move unused buffers to freelist
Date: Fri, 24 May 2013 12:25:29 +0530
Message-ID: <006001ce584b$adfc55f0$09f501d0$@kapila@huawei.com> (raw)
In-Reply-To: <519E873D.5000406@nasby.net>
References: <002f01ce50a8$e057c7a0$a10756e0$@kapila@huawei.com>
	<51928CDA.7030009@2ndQuadrant.com>
	<519E873D.5000406@nasby.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

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



view thread (39+ messages)  latest in thread

Message-ID: <006001ce584b$adfc55f0$09f501d0$@kapila@huawei.com>
Permalink:  ../006001ce584b$adfc55f0$09f501d0$@kapila@huawei.com/
Also on:    postgresql.org/message-id/006001ce584b$adfc55f0$09f501d0$@kapila@huawei.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: amit.kapila@huawei.com, jim@nasby.net, greg@2ndQuadrant.com
  Subject: Re: Move unused buffers to freelist
  In-Reply-To: <006001ce584b$adfc55f0$09f501d0$@kapila@huawei.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox