how to flush out cache.?
Matthew Dillon
dillon at apollo.backplane.com
Wed Apr 21 20:48:43 PDT 2004
: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 at backplane.com>
More information about the freebsd-hackers
mailing list