This is a discussion on Re: Disposal of a misleading M_TRYWAIT - FreeBSD ; 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 ...
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
University of Cambridge
email@example.com mailing list
To unsubscribe, send any mail to "firstname.lastname@example.org"