From owner-freebsd-net Sat Jul 15 10:48:40 2000 Delivered-To: freebsd-net@freebsd.org Received: from field.videotron.net (field.videotron.net [205.151.222.108]) by hub.freebsd.org (Postfix) with ESMTP id BAAE637B6DD; Sat, 15 Jul 2000 10:48:35 -0700 (PDT) (envelope-from bmilekic@dsuper.net) Received: from modemcable009.62-201-24.mtl.mc.videotron.net ([24.201.62.9]) by field.videotron.net (Sun Internet Mail Server sims.3.5.1999.12.14.10.29.p8) with ESMTP id <0FXQ00LULZYR5D@field.videotron.net>; Sat, 15 Jul 2000 12:47:15 -0400 (EDT) Date: Sat, 15 Jul 2000 12:49:38 -0400 (EDT) From: Bosko Milekic Subject: Re: mbuf refcnt and sendfile In-reply-to: <20000715093844.D25571@fw.wintelcom.net> X-Sender: bmilekic@jehovah.technokratis.com To: Alfred Perlstein Cc: net@FreeBSD.ORG, dg@FreeBSD.ORG, dillon@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 Sat, 15 Jul 2000, Alfred Perlstein wrote: > And why exactly don't you have to splimp if it's a linked list? Because you're checking the pointer in the isolated mbuf which cannot be modified by anything but the owner. If you check the reference counter which is general, it can be incremented or manipulated by any other code. > I assume you mean an object may be referenced by more than just mbufs, > the solution is simple, you just keep that count seperate: Yes, which is feasible presently without the need for the thing you suggested. [...] > Also, the refcounting can be done with atomic operations therefore > you won't need spl, if you atomically decrease the ref and it's > zero, then the network stack doesn't have access to it. When you increase the reference count, it's not exactly atomic as you may be offsetting into a location, it may produce more than one instruction in which case you may catch an interrupt in between where things will get broken. > Lastly your changes bloat the size of an mbuf by 12 bytes, although > really only 8 because ext_args isn't needed. You don't need that data anyway. When you M_EXT, you don't use the data area of the mbuf. -- 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