Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Jul 2000 08:40:03 -0700 (PDT)
From:      Bosko Milekic <bmilekic@dsuper.net>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/19866: The mbuf subsystem presently uses a horrible referencing scheme for external
Message-ID:  <200007151540.IAA51905@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/19866; it has been noted by GNATS.

From: Bosko Milekic <bmilekic@dsuper.net>
To: Alfred Perlstein <bright@wintelcom.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/19866: The mbuf subsystem presently uses a horrible referencing scheme for external
Date: Sat, 15 Jul 2000 11:05:03 -0400 (EDT)

 	I disagree. Especially since you haven't said why it's better than
 	what's proposed.
 
 	Of course, here's the reason why: If you are holding a POINTER to an
 	outside reference counter, then you make think
 	that you're accomodating things for counters outside the subsystem
 	but in reality, if you are allocating objects of dynamic size with
 	malloc() at some point, you don't really want to have to allocate and
 	manage a reference count scheme for that one object anyway. 
 	I don't know about you but I want to be able to do malloc(),
 	MEXTADD() the ext_buf to the mbuf, and be ready to go. Then, if
 	m_copym ever gets called on my mbuf (or my mbuf is in the chain), I
 	want it to be taken care of by itself, such that when the mbuf is
 	freed, the ext_buf necessarily won't be. I don't want to have to
 	malloc() extra space for a counter.
 
 	So the point is: the mbuf subsystem is supposed to transparently
 	manage the reference count scheme for itself and if the ext_free
 	routine is called and there is an external reference (you can pass it
 	using the ext_args pointer) then you don't necessarily need to free
 	the object.
 
 	If you still think it should be otherwise, let me know why and I'll
 	change it, but I would like to get this off my back as soon as
 	possible.
 
 On Fri, 14 Jul 2000, Alfred Perlstein wrote:
 
 > This is not how it should be done.
 > 
 > 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.
 > 
 > -- 
 > -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
 
 
 --
  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-bugs" in the body of the message




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