From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 17 16:59:23 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 2270316A421 for ; Mon, 17 Oct 2005 16:59:23 +0000 (GMT) (envelope-from sangwoos@gmail.com) Received: from qproxy.gmail.com (qproxy.gmail.com [72.14.204.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5E82043D48 for ; Mon, 17 Oct 2005 16:59:22 +0000 (GMT) (envelope-from sangwoos@gmail.com) Received: by qproxy.gmail.com with SMTP id a39so825443qbd for ; Mon, 17 Oct 2005 09:59:21 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=oxstNY7AEnesA0sQB6zdMBEKrD/Hsn8vZ+/A0kmTXr9yNeH2ajBcUi35GrrsZfR/4YKKYK2aAylX1l/i+S6uShKbfgqC19QfKu3xxH+fIYI1Q4UzIEZ0pC4a6uMbMrObywzH7gM4cCexjBfn8Q1ldDIvlmAO6dSXibmSu4D0WAM= Received: by 10.65.119.7 with SMTP id w7mr2161170qbm; Mon, 17 Oct 2005 09:59:21 -0700 (PDT) Received: by 10.65.52.5 with HTTP; Mon, 17 Oct 2005 09:59:21 -0700 (PDT) Message-ID: <4cbd01f40510170959l30f90bc1k@mail.gmail.com> Date: Tue, 18 Oct 2005 01:59:21 +0900 From: Sangwoo Shim To: kamal kc In-Reply-To: <20051017122657.58723.qmail@web35703.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20051017120734.GA820@taran.infoua.com.ua> <20051017122657.58723.qmail@web35703.mail.mud.yahoo.com> Cc: freebsd-net@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: malloc() in kernel and increasing mbuf and cluster size X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2005 16:59:23 -0000 2005/10/17, kamal kc : > > > sys/malloc.h has function prototypes for malloc() > > > kern/kern_malloc.c defines the malloc() > > > > > > the malloc() definition is > > > > > > void * > > > malloc(size, type, flags) > > > unsigned long size; > > > struct malloc_type *type; > > > int flags; > > > > > > i understand the size and flags but what shall i > > > do with the malloc_type. > > > > man 9 malloc :-) > > > > i saw the man pages. > > it says to use malloc_type via > > MALLOC_DEFINE(type,shortdesc,longdesc) > MALLOC_DECLARE(type) > > the man pages use M_FOOBUF(where did it come from ??) > in the field type. > > Now how should i code it. > > struct malloc_type mytype; > mytype=3DMALLOC_DEFINE(.....,"mybuffers","mybuffers"); > > what should i put in the type field ?? > > thanks in advance, > kamal malloc type is defined for some kind of statistics/trackings. If you define some specific malloc types for your module/driver etc., you can track the memory usage more accurately. For example, if you do vmstat -= m you can see how much memories are used for specific allocations by looking at type field. Regards, Sangwoo Shim > > > > > > > > > __________________________________ > Yahoo! Music Unlimited > Access over 1 million songs. Try it free. > http://music.yahoo.com/unlimited/ > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= " >