From 6d90eaaa89a007e0d365f49d6436f35d2392cfeb Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Thu, 26 Jan 2012 18:19:48 +0200 Subject: 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. --- src/include/storage/proc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/include/storage/proc.h') diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index 358d1a456cb..b68ae39268e 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -188,6 +188,8 @@ typedef struct PROC_HDR PGPROC *freeProcs; /* Head of list of autovacuum's free PGPROC structures */ PGPROC *autovacFreeProcs; + /* BGWriter process latch */ + Latch *bgwriterLatch; /* Current shared estimate of appropriate spins_per_delay value */ int spins_per_delay; /* The proc of the Startup process, since not in ProcArray */ -- cgit v1.2.3