From owner-freebsd-current@FreeBSD.ORG Thu Feb 17 20:24:39 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C7E2A16A4CE for ; Thu, 17 Feb 2005 20:24:39 +0000 (GMT) Received: from pi.codefab.com (pi.codefab.com [199.103.21.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6532C43D53 for ; Thu, 17 Feb 2005 20:24:39 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from localhost (localhost [127.0.0.1]) by pi.codefab.com (Postfix) with ESMTP id C50985DE0; Thu, 17 Feb 2005 15:24:38 -0500 (EST) Received: from pi.codefab.com ([127.0.0.1]) by localhost (pi.codefab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 58613-09; Thu, 17 Feb 2005 15:24:38 -0500 (EST) Received: from [192.168.1.3] (pool-68-161-50-112.ny325.east.verizon.net [68.161.50.112]) by pi.codefab.com (Postfix) with ESMTP id 9A66C5DCC; Thu, 17 Feb 2005 15:24:36 -0500 (EST) Message-ID: <4214FD67.7060801@mac.com> Date: Thu, 17 Feb 2005 15:24:07 -0500 From: Chuck Swiger Organization: The Courts of Chaos User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Joseph Koshy References: <1108584730.95661.12.camel@server.mcneil.com> <20050216201716.GA28436@odin.ac.hmc.edu> <4213B3C8.3090508@centtech.com> <1108588393.12275.9.camel@server.mcneil.com> <20050216214031.GA2787@odin.ac.hmc.edu> <4213D3AA.70809@elischer.org> <84dead72050217081540fd7640@mail.gmail.com> In-Reply-To: <84dead72050217081540fd7640@mail.gmail.com> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at codefab.com cc: Julian Elischer cc: current@freebsd.org Subject: Re: where did all my memory go? (file system cache) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Feb 2005 20:24:39 -0000 Joseph Koshy wrote: >> what I want is: >> >> int fd = open("myfile",...); >> write1GBfiletodisk(fd, data); >> ioctl(fd, PURGEFROMCACHE); >> perform_md5(fd); >> >>and be sure that teh MD5 is that of what is on the disk. >>not what is in RAM. > > unmount(file-system-of("myfile")) (even if it fails) ? That's actually a pretty good suggestion, and is less intrusive than, say rebooting, which is probably the only way to be entirely sure that the write cache on the drive itself has been flushed. If the write cache is off, Julian probably ought to be able to trust fsync(2)...? -- -Chuck