From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 17 11:49:02 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 A662316A41F for ; Mon, 17 Oct 2005 11:49:02 +0000 (GMT) (envelope-from kamal_ckk@yahoo.com) Received: from web35711.mail.mud.yahoo.com (web35711.mail.mud.yahoo.com [66.163.179.165]) by mx1.FreeBSD.org (Postfix) with SMTP id 06DBC43D53 for ; Mon, 17 Oct 2005 11:49:01 +0000 (GMT) (envelope-from kamal_ckk@yahoo.com) Received: (qmail 32414 invoked by uid 60001); 17 Oct 2005 11:49:01 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Y0gdjAS2gVbg8HyqdXaNY9kKH4nxrIHPsQCG47r8QWj6iH08bm8O5t7f7hOACBQyYZ/C/3qCsF8Iot0zH+9VsLZj9DRG4mG5Fxe4yJYAKV7+aCYAXhuqFxUksaQGk28Q2o2VsuNULpiadwJgTZduQx5KO1XZ60sNqKR0V18//dY= ; Message-ID: <20051017114901.32412.qmail@web35711.mail.mud.yahoo.com> Received: from [202.79.62.15] by web35711.mail.mud.yahoo.com via HTTP; Mon, 17 Oct 2005 04:49:01 PDT Date: Mon, 17 Oct 2005 04:49:01 -0700 (PDT) From: kamal kc To: freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: freebsd-hackers@freebsd.org Subject: 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 11:49:02 -0000 this may be a trivial question for many of you but i am confused in doing memory allocation in the kernel. 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. suppose i want to allocate 1024 bytes then how should i call the malloc ? i set --> size=1024 flags=M_WAITOK type=???? (i don't know what/how to initialize the type) Next thing is that i want to make the kernel process network packets very fast. i think of increasing the mbuf and cluster size. i want to if there will be any effect on increasing the mbuf and cluster size. what would be an appropriate size of mbuf and cluster if I use i. 512 MB RAM iI. 1024 MB RAM which parts of the kernel will be affected by changing the mbuf and cluster size ? i think somebody maybe able to help me. thanks folks. kamal __________________________________ Yahoo! Music Unlimited Access over 1 million songs. Try it free. http://music.yahoo.com/unlimited/