diff options
| author | Bruce Momjian | 2015-03-22 02:06:19 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2015-03-22 02:06:19 +0000 |
| commit | 34afbba84e8fd12bbf905d68d1112f51ed584df9 (patch) | |
| tree | a4e66fb4b46745b5996190dc467bdb1b36cc3318 /src/include | |
| parent | 9d61b9953c1489cbb458ca70013cf5fca1bb7710 (diff) | |
Use mmap MAP_NOSYNC option to limit shared memory writes
mmap() is rarely used for shared memory, but when it is, this option is
useful, particularly on the BSDs.
Patch by Sean Chittenden
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/portability/mem.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/include/portability/mem.h b/src/include/portability/mem.h index 7c77dbd128..a4b01fecae 100644 --- a/src/include/portability/mem.h +++ b/src/include/portability/mem.h @@ -30,6 +30,14 @@ #define MAP_HASSEMAPHORE 0 #endif +/* + * BSD-derived systems use the MAP_NOSYNC flag to prevent dirty mmap(2) + * pages from being gratuitously flushed to disk. + */ +#ifndef MAP_NOSYNC +#define MAP_NOSYNC 0 +#endif + #define PG_MMAP_FLAGS (MAP_SHARED|MAP_ANONYMOUS|MAP_HASSEMAPHORE) /* Some really old systems don't define MAP_FAILED. */ |
