Re: about MINCLSIZE
Re: about MINCLSIZE
- Subject: Re: about MINCLSIZE
- From: Andrew Gallatin <email@hidden>
- Date: Thu, 9 Jun 2005 15:02:00 -0400 (EDT)
chas williams - CONTRACTOR writes:
> is this definition for MINCLSIZE right?
>
> from sys/mbuf.h:
>
> /*
> * Mbufs are of a single size, MSIZE (machine/param.h), which
> * includes overhead. An mbuf may add a single "mbuf cluster" of size
> * MCLBYTES (also in machine/param.h), which has no additional overhead
> * and is used instead of the internal data area; this is done when
> * at least MINCLSIZE of data must be stored.
> */
>
> #define MLEN (MSIZE - sizeof(struct m_hdr)) /* normal data len */
> #define MHLEN (MLEN - sizeof(struct pkthdr)) /* data len w/pkthdr */
>
> #define MINCLSIZE (MHLEN + MLEN) /* smallest amount to put in cluster */
>
> based on the usage (and description) of MINCLSIZE i would guess it should
> be closer to MHLEN + 1. MHLEN + MLEN is essentially 2 * MSIZE which
> will not fit inside a single mbuf?
Mbufs may also be chained. You can easily encounter an mbuf chain of
multiple mbufs of any type.
For MINCLSIZE, I think the rationale is that it is cheaper, and wastes
less space to allocate another mbuf and chain them than it does to
allocate a cluster.
Drew
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >about MINCLSIZE (From: "chas williams - CONTRACTOR" <email@hidden>) |