In linux kernel will kfree call ever sleep?

The name is pretty much a question ...

I am writing code that uses spinlock to help manage lists. The spindle assembly documentation is pretty clear about not ringing anything to sleep. I know that there are ways to allocate memory that is "atomic", but I have not seen anything about kfree or freeing memory.

Intuition tells me that he should never sleep, but I did not find that this is obvious.

+4
source share
1 answer

No, he never sleeps. It is safe to call kfree from an arbitrary context. The only exception is NMI oopser and similar summary code.

+2
source

Source: https://habr.com/ru/post/1502856/


All Articles