From owner-freebsd-current@FreeBSD.ORG Wed Apr 23 14:49:52 2008 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D385C10656AB; Wed, 23 Apr 2008 14:49:52 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id 876878FC25; Wed, 23 Apr 2008 14:49:52 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper [152.3.145.30]) by duke.cs.duke.edu (8.14.2/8.14.2) with ESMTP id m3NEnqJW022374 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 Apr 2008 10:49:52 -0400 (EDT) X-DKIM: Sendmail DKIM Filter v2.5.3 duke.cs.duke.edu m3NEnqJW022374 Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id m3NEnOFt015072; Wed, 23 Apr 2008 10:49:24 -0400 (EDT) (envelope-from gallatin) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18447.19594.892539.640373@grasshopper.cs.duke.edu> Date: Wed, 23 Apr 2008 10:49:23 -0400 (EDT) To: Kris Kennaway In-Reply-To: <480F4972.20609@FreeBSD.org> References: <18447.17658.759349.720175@grasshopper.cs.duke.edu> <480F4972.20609@FreeBSD.org> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Cc: freebsd-current@FreeBSD.org Subject: Re: ZFS file caching question X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 23 Apr 2008 14:49:52 -0000 Kris Kennaway writes: > Andrew Gallatin wrote: > > If I have, say, 512MB RAM and a 1GB file which is written or read > > sequentially on an otherwise idle system, I'd expect the last 512MB (- > > epsilon) of the file's pages to be cached in RAM. This is true for > > UFS, but it does not appear to be the case with ZFS (see example > > below). > > > > Can somebody explain how the arc cache in ZFS relates to the normal > > page cache used by traditional filesystems? Are ZFS filesystems > > cached exclusively in the arc cache, and not in the page cache? Is > > the arc cache per-filesystem, per-pool, or global for ZFS as a whole? > > The ZFS arc cache is completely independent from the normal buffer cache > on FreeBSD. This is inefficient in a number of ways. I have also seen > things that make me suspicious that it is not caching properly even when > you tune it to be "large enough" (if possible given memory constraints), > but I haven't confirmed this. In some ways this is kind of cool. I'm want to use FreeBSD+ZFS for a new desktop which will also host a media server. If I put the media on ZFS, and my home directory on UFS, then the gigantic HD media files recorded overnight won't push my desktop applications out of RAM overnight. That's a feature :) > > Hmm.. Could this be the cause of the problems with ZFS and mmap'ed files? > > What problems do you mean? There were coherency problems but I think > they were fixed. The last I saw about this on -current was: http://lists.freebsd.org/pipermail/freebsd-current/2008-February/083396.html This seemed to terminate with people disabling mmap in the applications, not with a fix to ZFS. Maybe I missed a commit.. Thanks, Drew