Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Mar 2008 09:15:37 +0000 (GMT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Sam Leffler <sam@freebsd.org>
Cc:        arch@freebsd.org
Subject:   Re: Disposal of a misleading M_TRYWAIT
Message-ID:  <20080323091107.Y79412@fledge.watson.org>
In-Reply-To: <47E5D613.4060005@freebsd.org>
References:  <20080322105145.GA41672@team.vega.ru> <20080322135637.Y6961@fledge.watson.org> <200803230104.m2N14xlf026184@apollo.backplane.com> <20080322153658.K910@desktop> <47E5D613.4060005@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 22 Mar 2008, Sam Leffler wrote:

>> They have been the same allocator for some time now.  It makes more sense 
>> for them to use the same flags.
>
> We made a decision a while back to not use malloc flags for mbuf routine 
> arguments.  There are even assertions to verify it.  Changing the flag names 
> however would be a painful change for little gain.

However, this isn't just a search and replace patch on flag names.  M_TRYWAIT 
in fact does a Yoda suggests -- it doesn't "try", it just "does", and as a 
result none of the intermittently applied NULL-checking for M_TRYWAIT return 
paths can ever be executed.  Hence the are never tested, and new code is 
turning up that makes the assumption that these paths will never see failure. 
A significant part of Ruslan's patch is improving consistency in error 
handling by making all code consider the wait case unable to fail, and there's 
nothing quite like removing unused exceptional case handling to make network 
code easier to read.

I would also be fine with a proposal that replaces the existing M_DONTWAIT / 
M_TRYWAIT with mbuf allocator specific flags that read FOO_WAIT and FOO_NOWAIT 
(be it the same as in Dragonfly, MB_WAIT and MB_NOWAIT or otherwise).  It's 
certainl true that in other cases, we've tried hard to have allocator wrappers 
with enhanced functionality use their own flag namespace -- SF_WAIT, etc, but 
since the mbuf allocator really is UMA these days, I am also alright with 
using the UMA/malloc flags.

Robert N M Watson
Computer Laboratory
University of Cambridge




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