1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-24 09:27:52 +03:00

Make bgwriter sleep longer when it has no work to do, to save electricity.

To make it wake up promptly when activity starts again, backends nudge it
by setting a latch in MarkBufferDirty(). The latch is kept set while
bgwriter is active, so there is very little overhead from that when the
system is busy. It is only armed before going into longer sleep.

Peter Geoghegan, with some changes by me.
This commit is contained in:
Heikki Linnakangas
2012-01-26 18:19:48 +02:00
parent 467ff207f5
commit 6d90eaaa89
4 changed files with 165 additions and 28 deletions

View File

@@ -213,7 +213,7 @@ extern bool HoldingBufferPinThatDelaysRecovery(void);
extern void AbortBufferIO(void);
extern void BufmgrCommit(void);
extern void BgBufferSync(void);
extern bool BgBufferSync(void);
extern void AtProcExit_LocalBuffers(void);