From owner-freebsd-net Sat Jul 15 9:22:47 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 2BCC237B5E2; Sat, 15 Jul 2000 09:22:44 -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 <0FXQ000DRYTS2X@falla.videotron.net>; Sat, 15 Jul 2000 12:22:41 -0400 (EDT) Date: Sat, 15 Jul 2000 12:25:03 -0400 (EDT) From: Bosko Milekic Subject: Re: mbuf refcnt and sendfile In-reply-to: <20000715065506.Y25571@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: > http://www.freebsd.org/cgi/query-pr.cgi?pr=19866 > > David, I'm pretty sure you didn't like the 'fix' for the mbuf > cluster refcount presented in this PR (linking all copies using > a doubly linked list), I have presented an alternative: > > Instead of keeping them in a linked list there should be an int/char * > in the mbuf header that works the same way mclrefcnt does. Instead > of managing a linked list all one has to do is copy the pointer into > the new mbuf header and increment it, and decrease it on free, when > it's zero the deref code is called. This takes away from the transparency of the system and further adds the necessity of having to splimp() for something as simple as checking whether an mbuf's ext_buf is referenced by more than one object. If you keep the counter outside of the isolated mbuf (which is what you're suggesting with the pointer idea), then you have to splimp() before you check the value of the referred counter. > I was wondering what your thoughts on this are? > > I also had an idea to save on sf_buf's in sendfile: > > Forget about them, set the m_ext->ext_buf to point directly at the > vm_page_t backing the mbuf, you don't need the extra indirection. If the ext_buf referencing remains transparent, then you don't really need the extra indirection management, as far as I know! But I'm not sure! David probably knows this interface WAAAY better (he wrote it!) :-) > I think that could work if you did a vm_page_wire and pmap_qenter > for each mbuf ref callback and a vm_page_unwire and pmap_qremove > for each mbuf free callback. > > With the callback reducing optimization for mbuf clusters mentioned > first I think we may have pretty good optimization. > > What do you guys think? > > -- > -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] > "I have the heart of a child; I keep it in a jar on my desk." > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-net" in the body of the message > > -- 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