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 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

Re: [HACKERS] BGWriter latch, power saving

2012-01-26 Thread Peter Geoghegan
On 26 January 2012 16:48, Heikki Linnakangas 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, where bgwriter_delay is describe

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 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

Re: [HACKERS] BGWriter latch, power saving

2012-01-17 Thread Peter Geoghegan
On 17 January 2012 11:24, Heikki Linnakangas 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 both the existing code and my patch

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 wrote: I think SetBufferCommitInfoNeedsSave() needs the same treatment as MarkBufferDirty(). And it would probably be good to only set the latch if the buffer

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 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 al

Re: [HACKERS] BGWriter latch, power saving

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

Re: [HACKERS] BGWriter latch, power saving

2012-01-04 Thread Simon Riggs
On Wed, Jan 4, 2012 at 7:24 AM, Heikki Linnakangas 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 has been inactive. Continually waki

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 how

[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. Th