From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 18:40:13 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 DB4CB16A4CE for ; Wed, 21 Apr 2004 18:40:13 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D55943D53 for ; Wed, 21 Apr 2004 18:40:13 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) i3M1e97Z097496; Wed, 21 Apr 2004 18:40:09 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9p2/8.12.9/Submit) id i3M1e9l9097495; Wed, 21 Apr 2004 18:40:09 -0700 (PDT) (envelope-from dillon) Date: Wed, 21 Apr 2004 18:40:09 -0700 (PDT) From: Matthew Dillon Message-Id: <200404220140.i3M1e9l9097495@apollo.backplane.com> To: Julian Elischer References: cc: hackers@freebsd.org 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 01:40:14 -0000 :Actually what I'm looking for is :"throw away clean data" : :I want to dump the cached version of a file so that I can force a reread :of the disk. MS_INVALIDATE doesn't do that. madvise()'s MADV_FREE does what you want, BUT it does not currently work (at least on 4.x or in DFly) on file-backed data, it only works with anonymous memory. I believe that on some systems MADV_FREE does what you expect, e.g. like on Solaris (though I am not 100% sure), so it would not be far-fetched to go and implement it. -Matt Matthew Dillon