Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Dec 2000 22:17:03 -0800
From:      Alfred Perlstein <bright@wintelcom.net>
To:        Bosko Milekic <bmilekic@FreeBSD.org>
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>
In-Reply-To: <200012130513.eBD5D4s83055@freefall.freebsd.org>; from bmilekic@FreeBSD.org on Tue, Dec 12, 2000 at 09:13:03PM -0800
References:  <200012130513.eBD5D4s83055@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* Bosko Milekic <bmilekic@FreeBSD.org> [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




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