Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jul 2000 13:43:47 -0600
From:      "Kenneth D. Merry" <ken@kdm.org>
To:        Alfred Perlstein <bright@wintelcom.net>
Cc:        David Greenman <dg@root.com>, net@freebsd.org, dg@freebsd.org, wollman@freebsd.org
Subject:   Re: argh! Re: weird things with M_EXT and large packets
Message-ID:  <20000710134346.A26914@panzer.kdm.org>
In-Reply-To: <20000710000237.C25571@fw.wintelcom.net>; from bright@wintelcom.net on Mon, Jul 10, 2000 at 12:02:37AM -0700
References:  <20000709205124.A25571@fw.wintelcom.net> <200007100553.WAA01544@implode.root.com> <20000710000237.C25571@fw.wintelcom.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jul 10, 2000 at 00:02:37 -0700, Alfred Perlstein wrote:
> Actually, it does happen, you still need to vtophys once per
> mbuf/cluster, allowing someone to present super large clusters
> reduces allocation in the mbuf systems and cache utilization.
> 
> The detection of this situation is simply:
> 
> if ((mh_flags & M_EXT) != 0 && m->m_ext.ext_free != NULL
> 	&& (m_data % PAGE_SIZE) + m_len > PAGE_SIZE) {
> 	/* split */
> }
> 
> The mod operation acting on a power of two should reduce to a
> bitmask, so the overhead of doing this isn't that great.
> 
> The test could probably dispense with the EXT and ext_free checks
> and wind up faster than with them in.

Another way to do it would be to have a flag that tells the driver that it
should check for fragmentation.  You'll just need to make sure that the
flag gets copied in the right places in the mbuf code when mbufs are
copied, etc.  (An easy way to check that out is to see what the mbuf code
does with M_EXT.)

> Mike Smith pointed me at some macros/functions that NetBSD uses to
> accomplish this, I'll be investigating them as I'd rather make a
> single allocation than one per 4k page.

Yeah, if we're going to do this, we'll want a common set of routines to
traverse the memory and pull out the various chunks.

Ken
-- 
Kenneth Merry
ken@kdm.org


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




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