KASSERT_WARN for asserting malloc(M_WAITOK) not in a non-sleepable thread
Bryan Drewery
bdrewery at FreeBSD.org
Thu Sep 25 15:30:43 UTC 2014
On 9/25/2014 2:46 AM, Konstantin Belousov wrote:
> 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.
Ah. I understand now, the check for M_WAITOK is wrong, the KASSERT needs
to move out of that.
--
Regards,
Bryan Drewery
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20140925/5a0149b0/attachment.sig>
More information about the freebsd-arch
mailing list