[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
BSD network memory allocation bug
- Date: Fri, 21 May 1999 12:25:28 -0600
- From: eric at cls.usask.ca (Eric Norum)
- Subject: BSD network memory allocation bug
Quality Quorum wrote:
> I do not bleive that RTOS has to follow same logic UNIX in the case:
>
> 1. Work load of RTOS stuff is more predictale so in many
> cases there is enough information to figure out
> necessary size of mbuf free list.
>
> 2. All IP based protocols will recover from packet loss
> without too many problems.
>
> 3. Memory is cheap.
>
> So, the most natuarl thing is to have pool of mbuffs and return
> NULL in all cases (WAIT and NO_WAIT) when it is exhausted.
>
But this is exactly what cant *not* be done. The FreeBSD code (and many RTEMS network drivers) assume that a valid pointer will be returned in response to an M_WAIT mbuf request. I propose to make that assumption valid when I rewrite m_mballoc and m_clalloc. My previous posting was just asking for confirmation that the FreeBSD code did, indeed, have a bug.
--
Eric Norum eric at cls.usask.ca
Saskatchewan Accelerator Laboratory Phone: (306) 966-6308
University of Saskatchewan FAX: (306) 966-6058
Saskatoon, Canada.