Mark Kirkwood <markir@paradise.net.nz> writes:
> Tom Lane wrote:
>> Mark, can you detect "hiccups" in the read rate using
>> your setup?
> I think so, here's the vmstat output for 400MB of shared_buffers during
> the scan:
Hm, not really a smoking gun there. But just for grins, would you try
this patch and see if the numbers change?
regards, tom lane
*** src/backend/storage/buffer/freelist.c.orig Fri Jan 5 18:02:12 2007
--- src/backend/storage/buffer/freelist.c Mon Mar 5 16:33:11 2007
***************
*** 104,116 ****
* it; decrement the usage_count and keep scanning.
*/
LockBufHdr(buf);
- if (buf->refcount == 0 && buf->usage_count == 0)
- return buf;
if (buf->usage_count > 0)
{
buf->usage_count--;
! trycounter = NBuffers;
}
else if (--trycounter == 0)
{
/*
--- 104,116 ----
* it; decrement the usage_count and keep scanning.
*/
LockBufHdr(buf);
if (buf->usage_count > 0)
{
buf->usage_count--;
! trycounter = NBuffers + 1;
}
+ if (buf->refcount == 0 && buf->usage_count == 0)
+ return buf;
else if (--trycounter == 0)
{
/*