Subject: Re: m_defrag() addition
To: Jason Thorpe <thorpej@shagadelic.org>
From: Sam Leffler <sam@errno.com>
List: tech-kern
Date: 03/02/2005 19:37:15
Jason Thorpe wrote:
> 
> On Mar 2, 2005, at 5:14 PM, Sam Leffler wrote:
> 
>> As to this suggestion, it can easily be done but if you use an 
>> algorithm that modifies the mbuf chain (e.g. by compacting in-place)
> 
> 
> Unfortunately, in NetBSD it is very common for mbufs to not be 
> compactable in-place, because mbufs are often read-only (buffers loaned 
> from userspace to the kernel).

FreeBSD has similar issues. My "in-place algorithm" currently uses 2 
techniques: copy forward (when there's trailing space) or replace 2 
mbufs by a replacement that combines them.  I'm trying to find time to 
evaluate whether this scheme is a win over just doing the blind copy 
given the subsequent cost of setting up s/g dma, etc.

	Sam