Re: Page replacement algorithm in buffer cache - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Page replacement algorithm in buffer cache
Date
Msg-id 3949.1364921816@sss.pgh.pa.us
Whole thread Raw
In response to Re: Page replacement algorithm in buffer cache  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: Page replacement algorithm in buffer cache
Re: Page replacement algorithm in buffer cache
List pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
> On 2013-04-02 12:22:03 -0400, Tom Lane wrote:
>> I agree in general, though I'm not sure the bgwriter process can
>> reasonably handle this need along with what it's already supposed to be
>> doing.  We may need another background process that is just responsible
>> for keeping the freelist populated.

> What else is the bgwriter actually doing otherwise? Sure, it doesn't put the
> pages on the freelist, but otherwise its trying to do the above isn't it?

I think it will be problematic to tie buffer-undirtying to putting both
clean and dirty buffers into the freelist.  It might chance to work all
right to use one scan process for both, but I'm afraid it's more likely
that we'd end up either overserving one goal or underserving the other.

Also note the entire design of BgBufferSync right now is predicated on
the assumption that the rate of motion of the scan strategy point
reflects the rate at which new buffers are needed.  If backends are
supposed to always get new buffers from the freelist, that logic becomes
circular: the bgwriter would be watching itself.  Perhaps we can
refactor the feedback control loop logic so that the buffer scan rate is
driven by changes in the length of the freelist, but I'm not sure
exactly what the consequences would be.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Page replacement algorithm in buffer cache
Next
From: Andres Freund
Date:
Subject: Re: Page replacement algorithm in buffer cache