From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 3 09:16:12 2003 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 4DC3437B401 for ; Sun, 3 Aug 2003 09:16:12 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8028143F75 for ; Sun, 3 Aug 2003 09:16:11 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.9/8.12.9) with ESMTP id h73GF3ai000251; Sun, 3 Aug 2003 12:15:03 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)h73GF3a6000248; Sun, 3 Aug 2003 12:15:03 -0400 (EDT) Date: Sun, 3 Aug 2003 12:15:03 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: david ramblewski In-Reply-To: <20030803140545.M99345@nerim.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd hackers Subject: Re: FFS 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: Sun, 03 Aug 2003 16:16:12 -0000 On Sun, 3 Aug 2003, david ramblewski wrote: > I am modifying the mount code and i find this: > malloc(...,M_UFSMNT,...) > > In malloc.h: > #define M_UFSMNT 28 > > There is a lot of "define" about filesystems in malloc.h and it seems to > represent every types of memories which can be allocated. I'm searching > in the source but i don't know how and why they use it. Someone knows > the solution? I don't believe code looking like this has existed in FreeBSD since 2.x, or maybe early 3.x; what version of the source code are you using? I noticed recently that Darwin uses this approach still, however. In FreeBSD 4.x and 5.x (and I believe 3.x), malloc types are defined using the MALLOC_DEFINE() macro, and declared using MALLOC_DECL(). You can read the malloc(9) man page for some details on how to use the buckets. If you use vmstat -m, you can see reports on the bucket sizes and allocation on a running kernel. > Does someone knows where i can find documentations about filesystems > under BSD (FFS). I'd suggest starting with the "BSD Book" -- Design and Implementation of 4.4BSD by McKusick, et al. That should include some basic background on the fast file system. More recently, you'll want to read the USENIX/FREENIX/BSDCON papers on Soft Updates, background file system checking, snapshotting, et al. Take a look at the USENIX web site for these papers. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories