Date: Mon, 3 Jan 2000 19:51:00 +0100 From: Guido van Rooij <guido@gvr.org> To: Peter Wemm <peter@netplex.com.au> Cc: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>, vsilyaev@mindspring.com, dillon@freebsd.org, freebsd-emulation@FreeBSD.ORG, dbutter@wireless.net Subject: Re: VMware: Questions... Message-ID: <20000103195100.A44079@gvr.gvr.org> In-Reply-To: <19991231010245.C630E1CA0@overcee.netplex.com.au>; from Peter Wemm on Fri, Dec 31, 1999 at 09:02:45AM %2B0800 References: <guido@gvr.org> <19991231010245.C630E1CA0@overcee.netplex.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 31, 1999 at 09:02:45AM +0800, Peter Wemm wrote:
> > a directory entry in the file system. This could even be done for the general
> > mmap call (provided a regular file of course). But it might be a very
> > specific situation because one usually would not used a file backed
> > mmap in FreeBSD, yet use an anonymous mmap.
>
> I had a go, it turned out to be quite easy (so far). I haven't finished
> verifying that it's doing everything exactly as expected yet though.
I am now using the following patch. I had a printf in the if clause
to see if other processes would use the code, but vmware seems the only one.
In fact I have been thinking about an fcntl() for files to b able
to specify the nosync option. This would be handy in mkstemp().
However Bruceb thinks it would not result in much improvement.
-Guido
--- vm_mmap.c.orig Sun Dec 12 04:19:29 1999
+++ vm_mmap.c Fri Dec 24 10:08:37 1999
@@ -1024,6 +1024,14 @@
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;
+ }
}
}
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-emulation" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000103195100.A44079>
