mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
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
This commit is contained in:
@ -368,7 +368,7 @@ dsm_impl_posix(dsm_op op, dsm_handle handle, Size request_size,
|
||||
|
||||
/* Map it. */
|
||||
address = mmap(NULL, request_size, PROT_READ | PROT_WRITE,
|
||||
MAP_SHARED | MAP_HASSEMAPHORE, fd, 0);
|
||||
MAP_SHARED | MAP_HASSEMAPHORE | MAP_NOSYNC, fd, 0);
|
||||
if (address == MAP_FAILED)
|
||||
{
|
||||
int save_errno;
|
||||
@ -960,7 +960,7 @@ dsm_impl_mmap(dsm_op op, dsm_handle handle, Size request_size,
|
||||
|
||||
/* Map it. */
|
||||
address = mmap(NULL, request_size, PROT_READ | PROT_WRITE,
|
||||
MAP_SHARED | MAP_HASSEMAPHORE, fd, 0);
|
||||
MAP_SHARED | MAP_HASSEMAPHORE | MAP_NOSYNC, fd, 0);
|
||||
if (address == MAP_FAILED)
|
||||
{
|
||||
int save_errno;
|
||||
|
Reference in New Issue
Block a user