Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Jun 2005 20:07:12 -0500 (CDT)
From:      Mike Silbersack <silby@silby.com>
To:        jun lu <junlu_nudt@yahoo.com.cn>
Cc:        freebsd-net@freebsd.org
Subject:   Re: some question about mbuf reuse
Message-ID:  <20050604200407.U14750@odysseus.silby.com>
In-Reply-To: <20050601032104.65888.qmail@web15502.mail.cnb.yahoo.com>
References:  <20050601032104.65888.qmail@web15502.mail.cnb.yahoo.com>

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

On Wed, 1 Jun 2005, jun lu wrote:

>   our project write a web server in freebsd kernel. we can receive and 
> send data directly in kernel.Now i have some idea, i think i can creat a 
> mbuf with cluster buffer before i send some data,because the data i want 
> to send are all in kernel,so i can take thest data in cluster i create 
> before,and transfer this mbuf to sosend(),then i make tcp/ip cann't 
> release this mbuf after it received the ack.In this way, i can send data 
> in kernel next time use the same mbuf with different cluster.i am not 
> sure whether this way can enhance the performance.So,i hope some one can 
> discuss with me

I don't think that what you are proposing would work.  Mbuf clusters can 
be used in multiple mbuf chains at the same time, but I don't see how you 
could do that with mbufs.  You probably should focus your optimization 
efforts elsewhere, because changing the mbuf api would make your code 
diverge too much from the standard FreeBSD kernel to be useful to anyone.

Mike "Silby" Silbersack



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