Date: Tue, 12 Dec 2000 11:48:11 -0800 From: Alfred Perlstein <bright@wintelcom.net> To: John Baldwin <jhb@FreeBSD.org> Cc: jasone@FreeBSD.org, net@FreeBSD.org, Bosko Milekic <bmilekic@technokratis.com> Subject: Re: MEXT_IS_REF broken. Message-ID: <20001212114810.H16205@fw.wintelcom.net> In-Reply-To: <XFMail.001212083927.jhb@FreeBSD.org>; from jhb@FreeBSD.org on Tue, Dec 12, 2000 at 08:39:27AM -0800 References: <20001212014429.Y16205@fw.wintelcom.net> <XFMail.001212083927.jhb@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
* John Baldwin <jhb@FreeBSD.org> [001212 08:39] wrote:
>
> On 12-Dec-00 Alfred Perlstein wrote:
> > grr...
> >
> > considering this:
> >
> >#define MEXT_IS_REF(m) ((m)->m_ext.ref_cnt->refcnt > 1)
> >
> >#define MEXT_REM_REF(m) do { \
> > KASSERT((m)->m_ext.ref_cnt->refcnt > 0, ("m_ext refcnt < 0")); \
> > atomic_subtract_long(&((m)->m_ext.ref_cnt->refcnt), 1); \
> > } while(0)
> >
> > this:
> >
> >#define MEXTFREE(m) do { \
> > struct mbuf *_mmm = (m); \
> > \
> > if (MEXT_IS_REF(_mmm)) \
> > MEXT_REM_REF(_mmm); \
> >
> >
> > is not mpsafe. we _NEED_ some type that allows atomic dec and test
> > for 0.
>
> http://www.FreeBSD.org/~jhb/patches/refcount.patch
You do have a commit bit if I'm not mistaken. :)
--
-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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001212114810.H16205>
