KASSERT_WARN for asserting malloc(M_WAITOK) not in a non-sleepable thread

Konstantin Belousov kostikbel at gmail.com
Thu Sep 25 07:46:59 UTC 2014


On Wed, Sep 24, 2014 at 08:16:06PM -0500, Bryan Drewery wrote:
> By the way, it was mentioned to me that the interrupt assert may be
> wrong but from my understanding the thread is in an interrupt context if
> td_intr_nesting_level>0, so the check seems fine to me.

It is wrong not due to the test for the interrupt level, but because
you must not call malloc(9) from the interrupt context at all, regardless
of flags.  At very least, it causes recursion on the malloc/uma locks,
but also it should damage the uma state.


More information about the freebsd-arch mailing list