From owner-freebsd-performance@FreeBSD.ORG Fri Apr 16 14:57:23 2004 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 72EF016A4CE for ; Fri, 16 Apr 2004 14:57:23 -0700 (PDT) Received: from f7.mail.ru (f7.mail.ru [194.67.57.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id 29DB843D31 for ; Fri, 16 Apr 2004 14:57:23 -0700 (PDT) (envelope-from shmukler@mail.ru) Received: from mail by f7.mail.ru with local id 1BEbKR-000ISM-00; Sat, 17 Apr 2004 01:56:55 +0400 Received: from [24.184.137.35] by msg.mail.ru with HTTP; Sat, 17 Apr 2004 01:56:55 +0400 From: =?koi8-r?Q?=22?=Igor Shmukler=?koi8-r?Q?=22=20?= To: =?koi8-r?Q?=22?=Jim C.Nasby=?koi8-r?Q?=22=20?= Mime-Version: 1.0 X-Mailer: mPOP Web-Mail 2.19 X-Originating-IP: [24.184.137.35] Date: Sat, 17 Apr 2004 01:56:55 +0400 In-Reply-To: <20040416163845.GG87362@nasby.net> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Message-Id: cc: freebsd-performance@freebsd.org Subject: Re: How does disk caching work? X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: =?koi8-r?Q?=22?=Igor Shmukler=?koi8-r?Q?=22=20?= List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2004 21:57:23 -0000 > Is there a document anywhere that describes in detail how FreeBSD > handles disk caching? I've read Matt Dillon's description of the VM > system, but it deals mostly with programs, other than vague statements > such as 'FreeBSD uses all available memory for disk caching'. Well, the statement is not vague. FreeBSD has a unified buffer cache. This means that ALL AVAILABLE MEMORY IS A BUFFER CACHE for all device IO. > I think I know how caching memory mapped IO works for the most part, > since it should be treated just like program data, but what about files > that aren't memory mapped? What impact is there as pages move from > active to inactive to cache to free? What role do wired and buffer pages > play? If file is not memory mapped it is not in memory, is it? Where do you cache it? Maybe I am missing somewhing? Do you maybe want to know about node caching? When pages are rotated from active to inactive and then to cache buckets they is still retains vnode references. Once it is in free queue, there is no way to put it back to cache. Association is lost. Wired pages are to pin memory. So that we do not get situation when fault handling code is paged out. I am not FreeBSD guru so I never heard of BUFFER pages. Is there such a concept? IS