From owner-freebsd-net Tue Dec 12 8:39:42 2000 From owner-freebsd-net@FreeBSD.ORG Tue Dec 12 08:39:37 2000 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from pike.osd.bsdi.com (pike.osd.bsdi.com [204.216.28.222]) by hub.freebsd.org (Postfix) with ESMTP id CD2F937B402; Tue, 12 Dec 2000 08:39:35 -0800 (PST) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by pike.osd.bsdi.com (8.11.1/8.9.3) with ESMTP id eBCGdME87547; Tue, 12 Dec 2000 08:39:22 -0800 (PST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20001212014429.Y16205@fw.wintelcom.net> Date: Tue, 12 Dec 2000 08:39:27 -0800 (PST) From: John Baldwin To: Alfred Perlstein Subject: RE: MEXT_IS_REF broken. Cc: jasone@FreeBSD.org, net@FreeBSD.org, Bosko Milekic Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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 > thanks, > -Alfred -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message