diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/pg_config_manual.h | 18 | ||||
| -rw-r--r-- | src/include/storage/bufmgr.h | 11 |
2 files changed, 18 insertions, 11 deletions
diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h index a2b2b614bec..96885bb9901 100644 --- a/src/include/pg_config_manual.h +++ b/src/include/pg_config_manual.h @@ -148,6 +148,24 @@ #endif /* + * Default and maximum values for backend_flush_after, bgwriter_flush_after + * and checkpoint_flush_after; measured in blocks. Currently, these are + * enabled by default if sync_file_range() exists, ie, only on Linux. Perhaps + * we could also enable by default if we have mmap and msync(MS_ASYNC)? + */ +#ifdef HAVE_SYNC_FILE_RANGE +#define DEFAULT_BACKEND_FLUSH_AFTER 0 /* never enabled by default */ +#define DEFAULT_BGWRITER_FLUSH_AFTER 64 +#define DEFAULT_CHECKPOINT_FLUSH_AFTER 32 +#else +#define DEFAULT_BACKEND_FLUSH_AFTER 0 +#define DEFAULT_BGWRITER_FLUSH_AFTER 0 +#define DEFAULT_CHECKPOINT_FLUSH_AFTER 0 +#endif +/* upper limit for all three variables */ +#define WRITEBACK_MAX_PENDING_FLUSHES 256 + +/* * USE_SSL code should be compiled only when compiling with an SSL * implementation. (Currently, only OpenSSL is supported, but we might add * more implementations in the future.) diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h index 821bee5ecea..c543ad6fdec 100644 --- a/src/include/storage/bufmgr.h +++ b/src/include/storage/bufmgr.h @@ -54,17 +54,6 @@ struct WritebackContext; extern PGDLLIMPORT int NBuffers; /* in bufmgr.c */ -#define WRITEBACK_MAX_PENDING_FLUSHES 256 - -/* FIXME: Also default to on for mmap && msync(MS_ASYNC)? */ -#ifdef HAVE_SYNC_FILE_RANGE -#define DEFAULT_CHECKPOINT_FLUSH_AFTER 32 -#define DEFAULT_BGWRITER_FLUSH_AFTER 64 -#else -#define DEFAULT_CHECKPOINT_FLUSH_AFTER 0 -#define DEFAULT_BGWRITER_FLUSH_AFTER 0 -#endif /* HAVE_SYNC_FILE_RANGE */ - extern bool zero_damaged_pages; extern int bgwriter_lru_maxpages; extern double bgwriter_lru_multiplier; |
