From owner-freebsd-net Wed Jun 28 11: 9:14 2000 Delivered-To: freebsd-net@freebsd.org Received: from falla.videotron.net (falla.videotron.net [205.151.222.106]) by hub.freebsd.org (Postfix) with ESMTP id 446BF37C270; Wed, 28 Jun 2000 11:09:08 -0700 (PDT) (envelope-from bmilekic@dsuper.net) Received: from modemcable009.62-201-24.mtl.mc.videotron.net ([24.201.62.9]) by falla.videotron.net (Sun Internet Mail Server sims.3.5.1999.12.14.10.29.p8) with ESMTP id <0FWV00CQ1MDC7D@falla.videotron.net>; Wed, 28 Jun 2000 14:08:00 -0400 (EDT) Date: Wed, 28 Jun 2000 14:09:59 -0400 (EDT) From: Bosko Milekic Subject: Re: mbuf re-write(s): v 0.2: request-for-comments In-reply-to: <14681.63578.312644.776689@grasshopper.cs.duke.edu> X-Sender: bmilekic@jehovah.technokratis.com To: Andrew Gallatin Cc: freebsd-hackers@freebsd.org, freebsd-net@freebsd.org Message-id: MIME-version: 1.0 Content-type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Wed, 28 Jun 2000, Andrew Gallatin wrote: > YES! This is wonderful news. > > I started coding device drivers on Digital UNIX and have long missed > this feature. I can't count the number of times I've gotten 90% of > the way through doing something with ext mubfs & thought to myself > "oh hell, now what am I going to do for an m_ext.ext_ref() function?" I can imagine. As I've previously mentionned, I'm thinking of adopting NetBSD's reference idea, as it seems very handy here. What it basically assumes is that if you're going to increase the reference count to an object, that you know one of the mbufs also referencing that object (since what you're doing is probably "copying" the data without having to actually perform a memory-to-memory copy -- the reason we have reference counts in the first place). So, if you know the mbuf referencing the same object, you will pass it to the macro and it will "increase a reference count" for it itself. What actually occurs is that the m_ext structure holds a forward/backward pointer (in the style of doubly-linked list) and is linked to all the other mbufs referencing the same object. This would isolate the referencing of external objects to the mbuf subsystem, such that callers don't have to worry about it at all, and can essentially get rid of the ext_ref() routine alltogether. > On a less enthusiastic note, the amount of whitespace changes make it > very difficult to eyeball your diff. Could you re-roll your diffs with > -b (to ignore your whitespace changes). Yeah, I made some "appearence/consistency/cleanliness" changes in /sys/sys/mbuf.h in order to maintain consistency and ensure easy readability of the final product. However, for readability purposes, I posted the no-whitespace-changes diff to the same place: http://www.technokratis.com/code/mbuf/ I should have done this immediately; thanks for the advice! Hope this helps. :-) > ------------------------------------------------------------------------------ > Andrew Gallatin, Sr Systems Programmer http://www.cs.duke.edu/~gallatin > Duke University Email: gallatin@cs.duke.edu > Department of Computer Science Phone: (919) 660-6590 Cheers, Bosko. -- Bosko Milekic * Voice/Mobile: 514.865.7738 * Pager: 514.921.0237 bmilekic@technokratis.com * http://www.technokratis.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message