Readme of Buffer Management seems to have wrong sentence

From: Amit Kapila <amit(dot)kapila(at)huawei(dot)com>
To: 'PostgreSQL-development' <pgsql-hackers(at)postgresql(dot)org>
Subject: Readme of Buffer Management seems to have wrong sentence
Date: 2012-05-09 01:37:14
Message-ID: 001c01cd2d84$432391f0$c96ab5d0$%kapila@huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

While going through Readme in backend\storage\buffer, I found some point
misleading.

Normal Buffer Replacement Strategy
---------------------------------- --------------
..

..

Each buffer header contains a usage counter, which is incremented (up to a
small limit value) whenever the buffer is unpinned. (This requires only the

buffer header spinlock, which would have to be taken anyway to decrement the

buffer reference count, so it's nearly free.)

.

I have checked the code and logic according to which usage counter is
increased when the buffer is pinned.

Another Doubt : Why in function BufferAlloc, it needs to hold the
BufFreelistLock till it pin the buffer which increases its reference count.

As what I understood is BufFreelistLock is
to protect StrategyControl structure and till it finds a buffer to use.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aidan Van Dyk 2012-05-09 02:04:46 Re: synchronous_commit and remote_write
Previous Message Tom Lane 2012-05-09 01:30:05 Re: Latch for the WAL writer - further reducing idle wake-ups.