diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2012-01-26 18:19:48 +0200 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2012-01-26 18:39:13 +0200 |
commit | 6d90eaaa89a007e0d365f49d6436f35d2392cfeb (patch) | |
tree | 625c4dc75f0067c438696b9ebc96715521635e2f /src/include/storage/bufmgr.h | |
parent | 467ff207f51439cadee7857d6a0874f34652ed53 (diff) | |
download | postgresql-6d90eaaa89a007e0d365f49d6436f35d2392cfeb.tar.gz postgresql-6d90eaaa89a007e0d365f49d6436f35d2392cfeb.zip |
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.
Diffstat (limited to 'src/include/storage/bufmgr.h')
-rw-r--r-- | src/include/storage/bufmgr.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h index a03c06874b7..de1bbd01d83 100644 --- a/src/include/storage/bufmgr.h +++ b/src/include/storage/bufmgr.h @@ -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); |