From owner-freebsd-emulation Mon Jan 3 10:51: 5 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from gvr.gvr.org (gvr.gvr.org [194.151.74.97]) by hub.freebsd.org (Postfix) with ESMTP id 8F8581508A; Mon, 3 Jan 2000 10:51:02 -0800 (PST) (envelope-from guido@gvr.org) Received: by gvr.gvr.org (Postfix, from userid 657) id D7399A84F; Mon, 3 Jan 2000 19:51:00 +0100 (CET) Date: Mon, 3 Jan 2000 19:51:00 +0100 From: Guido van Rooij To: Peter Wemm Cc: Hidetoshi Shimokawa , vsilyaev@mindspring.com, dillon@freebsd.org, freebsd-emulation@FreeBSD.ORG, dbutter@wireless.net Subject: Re: VMware: Questions... Message-ID: <20000103195100.A44079@gvr.gvr.org> References: <19991231010245.C630E1CA0@overcee.netplex.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.6i In-Reply-To: <19991231010245.C630E1CA0@overcee.netplex.com.au>; from Peter Wemm on Fri, Dec 31, 1999 at 09:02:45AM +0800 Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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