Memory reserves or lack thereof

Adrian Chadd adrian at freebsd.org
Mon Nov 12 02:02:38 UTC 2012


On 11 November 2012 13:40, Alan Cox <alan.l.cox at gmail.com> wrote:

>
> Agreed.  Once upon time, before SMPng, M_NOWAIT was rarely used.  It was
> well understand that it should only be used by interrupt handlers.
>
> The trouble is that M_NOWAIT conflates two orthogonal things.  The obvious
> being that the allocation shouldn't sleep.  The other being how far we're
> willing to deplete the cache/free page queues.
>
> When fine-grained locking got sprinkled throughout the kernel, we all to
> often found ourselves wanting to do allocations without the possibility of
> blocking.  So, M_NOWAIT became commonplace, where it wasn't before.

Well, what's the current set of best practices for allocating mbufs?

I don't mind going through ath(4) and net80211(4), looking to make it
behave better with mbuf allocations. There's 49 M_NOWAIT's in net80211
and 10 in ath(4). I wonder how many of them are synonyms with "don't
fail allocating", too. Hm.


Adrian


More information about the freebsd-hackers mailing list