Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Apr 2004 20:48:40 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Stephan Uphoff <ups@tree.com>
Cc:        Stephan Uphoff <ups@tree.com>
Subject:   Re: how to flush out cache.? 
Message-ID:  <200404220348.i3M3merS097986@apollo.backplane.com>
References:  <200404220152.VAA26897@stups.com>

next in thread | previous in thread | raw e-mail | index | archive | help

:Yes - but FreeBSD then calls vm_object_page_remove to remove the pages 
:from the vnode object. (vm_object_sync for 5.x or vm_map_clean for 4.x )
:
:Mhhh .. 4.X  removes the pages without flushing if the file is not write 
:mapped.
:This means that anyone with read access can screw up a file.
:( For example periodically throwing away pages from /var/log/wtmp ...)
:5.x looks better - but there is a race condition that can cause the same thing.
:I think for msync() the vm_object_page_remove() function should be called with 
:clean_only set to TRUE to avoid throwing away valid changes.
:( I will send-pr tomorrow )
:
:	Stephan

    I don't quite see that.  Could you point out the code in question?
    (And, of course, a test program would tell us for sure whether that
    hole exists).  There are two different things being removed... the
    page table entries are removed from pmap via the vm_map for the process,
    and the pages in the underlying object are being cleaned.

    Just removing pages from a pmap will not destroy the underlying pages.

    (I'm not saying that you are wrong, just that we need more information
    to figure out what is actually happening here).

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200404220348.i3M3merS097986>