kmalloc – useful macros

I encountered 2 useful macros

in_interrupt() – is code part ofinterrupt context / can’t sleep
in_atomic() – are we in context that is not preemptible

usage example:

tmp = kmalloc(sizeof(struct Node_t), in_interrupt()? GFP_ATOMIC : GFP_KERNEL);

 

באדיבות שוקי התותח 🙂

Asked on October 10, 2019 in Linux.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.