From owner-cvs-all Tue Dec 12 22:17: 8 2000 From owner-cvs-all@FreeBSD.ORG Tue Dec 12 22:17:04 2000 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 35ABF37B400; Tue, 12 Dec 2000 22:17:04 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id eBD6H3x09097; Tue, 12 Dec 2000 22:17:03 -0800 (PST) Date: Tue, 12 Dec 2000 22:17:03 -0800 From: Alfred Perlstein To: Bosko Milekic Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys mbuf.h Message-ID: <20001212221703.V16205@fw.wintelcom.net> References: <200012130513.eBD5D4s83055@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200012130513.eBD5D4s83055@freefall.freebsd.org>; from bmilekic@FreeBSD.org on Tue, Dec 12, 2000 at 09:13:03PM -0800 Sender: bright@fw.wintelcom.net Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Bosko Milekic [001212 21:13] wrote: > bmilekic 2000/12/12 21:13:03 PST > > Modified files: > sys/sys mbuf.h > Log: > Eliminate a race in MEXTFREE(). The reference counter decrement and test > was not atomic. We now make sure that we free the ext buf if the reference > count is about to reach 0 but also make sure that nobody else has done it > before us. > > While I'm here, change refcnt to u_int (from long). This fixes a compiler > warning regarding use of atomic_cmpset_long on i386. > > Submitted by: jasone > Reviewed by: jlemon, jake I object to what has been done here, I found the bug and now looking at the code took me about 10 minutes to verify that the bug (or some variant of it) didn't still exist. Can you take this code and wrap it with some API so that the mbuf code is cleaner (readable) and so that I can use it for things like ucred? I'd rather not inline this nastyness into anything I'm working on. If the code is really doing "atomic_dec_and_test" I really don't understand why we just can't have a function called atomic_dec_and_test. thanks, -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message