Review needed: Mbuf double-free detection patch

Luigi Rizzo rizzo at icir.org
Thu May 1 11:36:41 PDT 2003


On Thu, May 01, 2003 at 01:06:38PM -0400, Bosko Milekic wrote:
...
>   The reason it's done that way has to do with a bigger optimization
>   than just the avoidance of the extra function call: the cache lock is
>   held, as most as possible, across repeated calls to mb_free().  In
>   order to implement this "as most as possible," to allow for virtually
>   atomic frees in some cases, it was ripped out and done that way... if
>   you can figure out a cleaner way, that would be cool, though.

but according to the comment (and the code) that optimization
is not there yet because of issues in some of the functions
called in the body. Given that you have clearly documented what the
plan is and what the issues are, i would suggest to revert m_freem()
to use m_free() until those issues are solved. In addition to
reducing the code size, this would also reduce the risk that the
two pieces of code diverge by mistake.

	cheers
	luigi

> -- 
> Bosko Milekic
> bmilekic at unixdaemons.com
> bmilekic at FreeBSD.org
> 
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"


More information about the freebsd-net mailing list