From owner-freebsd-hackers Mon Feb 3 11:43:59 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id LAA16125 for hackers-outgoing; Mon, 3 Feb 1997 11:43:59 -0800 (PST) Received: from browncow.com (ch_asc1_p33.taconic.net [205.231.28.35]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id LAA16117 for ; Mon, 3 Feb 1997 11:43:52 -0800 (PST) Received: by browncow.com (951211.SGI.8.6.12.PATCH1042/940406.SGI) id OAA18041; Mon, 3 Feb 1997 14:42:02 -0500 Date: Mon, 3 Feb 1997 14:42:02 -0500 From: kish@browncow.com (Bill Kish) Message-Id: <199702031942.OAA18041@browncow.com> To: hackers@freefall.freebsd.org Subject: kernel malloc options Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Hi, I'm working on a a Network related module which performs a function similar to Network Address Translation. This module needs to dynamically allocate small (~40 byte) structures to keep track of currently established TCP connections between machines on the "inside" and "outside" networks. Currently, I'm malloc()ing these structures as needed using the following parameters: malloc((u_long)sizeof(*conxn), M_TEMP, M_NOWAIT) This appears to work fine in my initial lightly loaded tests, however, I'm concerned about what will happen when the system is under heavy load. I have the following questions and would appreciate any advice offered! 1) Is malloc() a reasonable allocator for small highly dynamic objects? 2) Is M_TEMP a good choice? Does it make a difference? 3) Are there any config options that affect the amount of pinned kernel memory available for malloc? The system will be doing little else besides dealing with these packets... Thanks In Advance, -BK --