[ECOS] Meaning of Mbuf statistics

Andrew Lunn andrew.lunn@ascom.ch
Mon Jan 14 00:39:00 GMT 2002


On Sat, Jan 12, 2002 at 10:21:54AM +0530, chandrag@danlawinc.com wrote:
> Hi,
> 
>    When I print the statistics of mbufs by calling the routine
> cyg_kmem_print_stats(), from a network test program  I got the
> following.
> 
> -------------------------------------------------------
> Network stack mbuf stats:
>    mbufs 2, clusters 2, free clusters 2
>    Failed to get 0 times
>    Waited to get 0 times
>    Drained queues to get 0 times
> Misc mpool: total   65520, free   62560, max free block 61604
> Mbufs pool: total   65408, free   65024, blocksize  128
> Clust pool: total  131072, free  124928, blocksize 2048
> -------------------------------------------------------
> 
>   Can anybody explain the meaning of the line
>       'mbufs 2, clusters 2, free clusters 2'?

mbufs are memory buffers used to hold parts of network packets. An
mbuf is quite small, 128 bytes. It contains a header and then
something like 100 bytes of data storage. You can chain them together
to form bigger storage area's or you can use a cluster. A cluster is
just a 2Kbytes buffer. A cluster can be linked to an mbuf. When this
happens the data is stored only in the cluster and not the mbuf.

This line is saying that currently two mbufs have been allocated from
the pool. Also 2 clusters have also been allocated. The free clusters
value is confusing. Clusters are not returned to the pool. Instead
they are placed on a linked list. This is saying there are two
clusters on this linked list of unused clusters.

         Andrew



More information about the Ecos-discuss mailing list