From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 20:48:43 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 23E2216A4CE for ; Wed, 21 Apr 2004 20:48:43 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id C3C1943D53 for ; Wed, 21 Apr 2004 20:48:42 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) i3M3me7Z097987; Wed, 21 Apr 2004 20:48:41 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9p2/8.12.9/Submit) id i3M3merS097986; Wed, 21 Apr 2004 20:48:40 -0700 (PDT) (envelope-from dillon) Date: Wed, 21 Apr 2004 20:48:40 -0700 (PDT) From: Matthew Dillon Message-Id: <200404220348.i3M3merS097986@apollo.backplane.com> To: Stephan Uphoff References: <200404220152.VAA26897@stups.com> cc: hackers@freebsd.org cc: Julian Elischer cc: Stephan Uphoff Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 03:48:43 -0000 :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