Andres Freund <and...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers