]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add MAP_NOSYNC feature to mmap(), and MADV_NOSYNC and MADV_AUTOSYNC to
authordillon <dillon@FreeBSD.org>
Sun, 12 Dec 1999 03:19:33 +0000 (03:19 +0000)
committerdillon <dillon@FreeBSD.org>
Sun, 12 Dec 1999 03:19:33 +0000 (03:19 +0000)
commitb66fb2c64801a0ee59e638561bfd8d3fe36b647c
treed1cf00b34925743e2181910ae5e72af2d03be373
parentaeee88b81a6982928d45c0d80c325cd8372bbab0
Add MAP_NOSYNC feature to mmap(), and MADV_NOSYNC and MADV_AUTOSYNC to
    madvise().

    This feature prevents the update daemon from gratuitously flushing
    dirty pages associated with a mapped file-backed region of memory.  The
    system pager will still page the memory as necessary and the VM system
    will still be fully coherent with the filesystem.  Modifications made
    by other means to the same area of memory, for example by write(), are
    unaffected.  The feature works on a page-granularity basis.

    MAP_NOSYNC allows one to use mmap() to share memory between processes
    without incuring any significant filesystem overhead, putting it in
    the same performance category as SysV Shared memory and anonymous memory.

Reviewed by: julian, alc, dg
15 files changed:
lib/libc/sys/madvise.2
lib/libc/sys/mmap.2
sys/kern/vfs_export.c
sys/kern/vfs_extattr.c
sys/kern/vfs_subr.c
sys/kern/vfs_syscalls.c
sys/sys/mman.h
sys/vm/vm_fault.c
sys/vm/vm_map.c
sys/vm/vm_map.h
sys/vm/vm_mmap.c
sys/vm/vm_object.c
sys/vm/vm_object.h
sys/vm/vm_page.c
sys/vm/vm_page.h