Subject: Re: m_get(), MGET(), and MGETHDR() with M_WAIT
From: Chris G Demetriou <Chris_G_Demetriou@ux2.sp.cs.cmu.edu>
Date: 06/07/1996 00:47:16
Some discussion with the relevant parties cause me to issue some
> What I found:
> (1) the M_WAIT/M_DONTWAIT distinction was added to the mbuf code
> by Mike Karels in 1985. Even if MGET/m_get had been
> documented in the tech report, the documentation wouldn't have
> been useful. 8-)
> (2) In the initial implementation, MGET/m_get with M_WAIT would never,
> ever return NULL. It would sleep for as long as necessary, and
> in the case of hopeless resource exhaustion (the equivalent of the
> cause of the current code's "mb_map full" panic), panic.
This is not strictly true. M_WAIT/M_DONTWAIT did exist earlier,
including in 4.2BSD. There were actually cases where MGET/m_get with
M_WAIT could return NULL. Indeed, looking at the code, it looks like
little, if any special-casing was done for the M_WAIT case.
Mike Karels interpreted that behaviour as a bug, and came up with the
current behavior (back in '85). 4.3BSD had the new behaviour, and
that behaviour (return an mbuf, sleep forever, or panic) is what
they teach in the various BSD tutorials, etc.
That pretty much wraps it for me; in my opinion, the checks of returns
from calls to MGET and friends with M_WAIT should be ripped out.