double-buffering page writes - Mailing list pgsql-hackers

From Alvaro Herrera
Subject double-buffering page writes
Date
Msg-id 20081021160437.GA4001@alvh.no-ip.org
Whole thread Raw
Responses Re: double-buffering page writes
List pgsql-hackers
Hi,

I'm trying to see if it makes sense to do the double-buffering of page
writes before going further ahead with CRC checking.  I came up with the
attached patch; it does the double-buffering inconditionally, because as
it was said, it allows releasing the io_in_progress lock (and resetting
BM_IO_IN_PROGRESS) early.

So far I have not managed to convince me that this is a correct change
to make; the io_in_progress bits are pretty convoluted -- for example, I
wonder how does "releasing" the buffer early (before actually sending
the write to the kernel and marking it not dirty) interact with
checkpoint and a possible full-page image.

Basically the change is to take the unsetting of BM_DIRTY out of
TerminateBufferIO and into its own routine; and in FlushBuffer, release
io_in_progress just after copying the buffer contents elsewhere, and
mark the buffer not dirty after actually doing the write.

Thoughts?

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: SSL cleanups/hostname verification
Next
From: Tom Lane
Date:
Subject: Re: [COMMITTERS] pgsql: SQL 200N -> SQL:2003