On 17.01.2012 12:16, Heikki Linnakangas wrote:
> On 04.01.2012 17:05, Peter Geoghegan wrote:
>> On 4 January 2012 07:24, Heikki Linnakangas
>> <heikki.linnakangas@enterprisedb.com> wrote:
>>> I think SetBufferCommitInfoNeedsSave() needs the same treatment as
>>> MarkBufferDirty(). And it would probably be good to only set the
>>> latch if
>>> the buffer wasn't dirty already. Setting a latch that's already set
>>> is fast,
>>> but surely it's even faster to not even try.
>>
>> That seems reasonable. Revised patch is attached.
>
> Thanks! It occurs to me that it's still a bad idea to call SetLatch()
> while holding the buffer header spinlock. At least when it's trivial to
> just move the call after releasing the lock. See attached.
>
> Could you do the sleeping/hibernating logic all in BgWriterNap()?
(sorry, forgot to update the above question before sending..)
In the patch I sent, I did rearrange the sleeping logic. I think it's
more readable the way it is now.
-- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com