From 00d76afededcbc8a271ccb6ebdf42347b69a670c Mon Sep 17 00:00:00 2001 From: Guido van Rooij Date: Mon, 3 Jan 2000 19:13:53 +0000 Subject: Use MAP_NOSYNC for vnodes without any links in their filesystem. This is necessary for vmware: it does not use an anonymous mmap for the memory of the virtual system. In stead it creates a temp file an unlinks it. For a 50 MB file, this results in a ot of syncing every 30 seconds. Reviewed by: Matthew Dillon --- sys/vm/vm_mmap.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sys/vm') diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 1721fd3e1bac..bb106f3d0094 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -1024,6 +1024,13 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, return (error); objsize = round_page(vat.va_size); type = OBJT_VNODE; + /* + * if it is a regular file without any references + * we do not need to sync it. + */ + if (vp->v_type == VREG && vat.va_nlink == 0) { + flags |= MAP_NOSYNC; + } } } -- cgit v1.3