Bug 31708

Summary: [vm] [vmware] VM system / fsync / flushing delayed indefinitely?
Product: Base System Reporter: jan grant <jan.grant>
Component: kernAssignee: Mark Linimon <linimon>
Status: Closed Overcome By Events    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description jan grant 2001-11-02 14:30:01 UTC
Recently the behaviour of vmware on my 4-STABLE machine has altered; I'm
not sure if this classes as a bug or not, so I'm soliciting opinions.
 
(This shows up using vmware 2.0.3.799_1, but does not appear to be limited
to that program)

Symptoms: vmware runs as normal. (I've got WinNT under it.) These days,
vmware2-2.0.3.799_1 will exit immediately if I suspend and exit the
program (as opposed to syncing status to disk - the VMware virtual
drive is mmapped by vmware).
 
However, I was slightly concerned when I came to shut down FreeBSD;
the external drive (which the VMWare virtual disk occupies) went into
several minutes of activity at the point where it was being unmounted.
 
This seemed odd; I've since done a bit of experimenting and the activity
can be triggered after exiting vmware (at pretty much an arbitrary
length of time) by fsyncing * in the vmware external directory.
 
There's quite a bit of memory in this machine (378MB) - my question is
this: is this a late flushing of mmapped pages marked dirty, or does
this behavior occur even if the pages were not touched? - And shouldn't
those pages (if dirty) be flushed to disk in a "reasonable" amount of
time*, rather than hanging around for (in one case) two weeks?
 
* sync(2) doesn't cause the flush; fsync(1 or 2) will.

How-To-Repeat: I found vmware handy for this because it mmaps a large file.
Run it, tinker, exit.
Wait an indefinite period (vmware's pages are not flushed).
Then either umount the fs with the vmware virtual disk or fsync those files.
sync(2) will not cause this flushing activity.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2015-03-12 04:34:57 UTC
To submitter: this PR seems to be ancient.  I am closing it on the supposition that it is no longer relevant.  Please let me know if this is not the case.