Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Feb 1997 14:42:02 -0500
From:      kish@browncow.com (Bill Kish)
To:        hackers@freefall.freebsd.org
Subject:   kernel malloc options
Message-ID:  <199702031942.OAA18041@browncow.com>

next in thread | raw e-mail | index | archive | help

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
--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702031942.OAA18041>