Re: [HACKERS] BGWriter latch, power saving

2012-01-26 Thread Heikki Linnakangas
On 17.01.2012 14:38, Peter Geoghegan wrote: On 17 January 2012 11:24, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: In the patch I sent, I did rearrange the sleeping logic. I think it's more readable the way it is now. I have no objection to either your refinement of the

Re: [HACKERS] BGWriter latch, power saving

2012-01-26 Thread Peter Geoghegan
On 26 January 2012 16:48, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: Ok, committed with some further cleanup. Do you think the docs need to be updated for this, and if so, where? The only place I found in the docs that speak about how the bgwriter works is in config.sgml,

Re: [HACKERS] BGWriter latch, power saving

2012-01-26 Thread Heikki Linnakangas
On 26.01.2012 21:37, Peter Geoghegan wrote: On 26 January 2012 16:48, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: Ok, committed with some further cleanup. Do you think the docs need to be updated for this, and if so, where? The only place I found in the docs that speak about

Re: [HACKERS] BGWriter latch, power saving

2012-01-17 Thread Heikki Linnakangas
On 04.01.2012 17:05, Peter Geoghegan wrote: On 4 January 2012 07:24, Heikki Linnakangas heikki.linnakan...@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

Re: [HACKERS] BGWriter latch, power saving

2012-01-17 Thread Heikki Linnakangas
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.linnakan...@enterprisedb.com wrote: I think SetBufferCommitInfoNeedsSave() needs the same treatment as MarkBufferDirty(). And it would probably be good

Re: [HACKERS] BGWriter latch, power saving

2012-01-17 Thread Peter Geoghegan
On 17 January 2012 11:24, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: In the patch I sent, I did rearrange the sleeping logic. I think it's more readable the way it is now. I have no objection to either your refinement of the sleeping logic, nor that you moved some things in

Re: [HACKERS] BGWriter latch, power saving

2012-01-04 Thread Simon Riggs
On Wed, Jan 4, 2012 at 7:24 AM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: Setting a latch that's already set is fast, but surely it's even faster to not even try. Agreed. I think we should SetLatch() at the first point a backend writes a dirty buffer because the bgwriter

Re: [HACKERS] BGWriter latch, power saving

2012-01-04 Thread Peter Geoghegan
On 4 January 2012 07:24, Heikki Linnakangas heikki.linnakan...@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

[HACKERS] BGWriter latch, power saving

2012-01-03 Thread Peter Geoghegan
As part of the ongoing effort to reduce wake-ups when idle/power consumption, the attached patch modifies the background writer to hibernate in ten second bursts once the bgwriter laps the clock sweep. It's fairly well commented, so a description of how it works here would probably be redundant.

Re: [HACKERS] BGWriter latch, power saving

2012-01-03 Thread Heikki Linnakangas
On 04.01.2012 07:58, Peter Geoghegan wrote: As part of the ongoing effort to reduce wake-ups when idle/power consumption, the attached patch modifies the background writer to hibernate in ten second bursts once the bgwriter laps the clock sweep. It's fairly well commented, so a description of